Claude Code Deletes Production Database After Terraform State File Error

A developer detailed how using Claude Code with Terraform resulted in the complete destruction of production infrastructure, including a database and its recovery snapshots, erasing 2.5 years of records.
What Happened
Alexey Grigorev was moving his website, AI Shipping Labs, to AWS to share infrastructure with DataTalks.Club. Claude Code advised against this setup, but Grigorev proceeded anyway to avoid maintaining separate infrastructures.
The Technical Error
Grigorev used Terraform, an infrastructure management tool that can create or destroy entire setups including networks, load balancers, databases, and servers. He had Claude run a Terraform plan to set up the new website but forgot to upload a vital state file that contains a full description of the existing setup.
Without the state file, Claude created duplicate resources. After identifying the duplicates, Grigorev uploaded the state file, expecting Claude to clean up the duplicates first. However, with the state file now available, Claude logically followed it and issued a Terraform "destroy" operation to prepare for a correct setup, which wiped the entire production infrastructure including the database and snapshots.
Key Takeaways
- Terraform state files are critical for infrastructure management
- AI coding agents follow instructions literally without understanding context
- Production environments require careful validation before destructive operations
- Missing state files can lead to catastrophic data loss
📖 Read the full source: HN LLM Tools
👀 See Also

Qwen 35B-A3B as always-on agent on 16GB M4 Mac: disk I/O fails before RAM
Running Qwen 35B-A3B with llama.cpp on a 16GB M4 Mac works for batch inference, but an always-on agentic loop alongside Claude Code and Codex CLI causes SSD contention that leads to system instability and missed cron jobs, despite RAM being fine.

Current State of Chinese LLMs: Market Leaders, Open Models, and Business Models
A Reddit analysis details the Chinese LLM landscape, identifying ByteDance's Doubao as the proprietary market leader and DeepSeek as the most innovative, while outlining the business models of major players and 'Six AI Small Tigers' focused on open-weight models.

Setting Up Subagents in OpenClaw: Key Considerations
Users experimenting with OpenClaw are facing issues with setting up subagents, particularly when modifying JSON files.

Gemma 4 Released: Four Model Sizes for Local AI Hosting
Google has released Gemma 4 with four model sizes optimized for different hardware, including edge devices, laptops, and GPUs. All models are multimodal with text and vision capabilities, and the smaller models support real-time audio.