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

Concerns Arise Over OpenClaw's Usability and Economic Viability
OpenClaw has been criticized for its high barriers to entry, prohibitive costs, security issues, and misleading memory capabilities. Alternative solutions like the MemU Bot have been recommended.

Analysis: Comparing the AI Industry to Subprime Mortgage Crisis Patterns
Edward Zitron's analysis draws parallels between the 2008 subprime mortgage crisis and current AI industry trends, citing specific data points about adjustable-rate mortgages and their similarities to AI investment patterns.

OpenClaw: Four Critical Issues Developers Need to Know
From image-passthrough bugs to dead channel adapters, lock file visibility, and missing parallel coordination — four production-impacting issues from the OpenClaw repo (366k stars).

AI Graveyard: 100 Shutdown & Acquired AI Tools Tracked – 88 in 2026 Alone
ToolDirectory.ai's AI Graveyard tracks 100 discontinued or acquired AI products, with 88 deaths recorded in 2026. Categories include Developer Tools, AI Agents, Customer Support, and more, with many acquisitions folding into larger platforms like Salesforce.