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

Developer pleads guilty to $8M AI music streaming fraud scheme
Michael Smith, 54, admitted to using thousands of bot accounts and AI-generated songs to siphon $8 million in royalties from streaming platforms including Spotify, Apple Music, and YouTube Music between 2017 and 2024.
OpenClaw 2026.9.6 Adds Claude Opus 5.5, GPT-6 Sol and Luna, Grok 4.7, Plus Restart Recovery
OpenClaw 2026.9.6 ships in 2,614 PRs from 351 contributors, adding Claude Opus 5.5, GPT-6 Sol and Luna, and Grok 4.7 models, restart recovery for unfinished conversations, a 30-day Usage report, and live meeting notes.

MiniMax M2.7 Model Shows Strong Performance as AI Coding Agent
A developer tested MiniMax M2.7 as their main AI coding agent and found it outperformed GPT 5.4 and Gemini 3.1 Pro in speed and tooling tasks, with benchmark scores of 56.22% on SWE-Pro and 57.0% on Terminal Bench 2.
Claude Code v2.1.140 Fixes Agent Tool Matching, /goal Hangs, Windows Event-Loop Stall
v2.1.140 improves Agent tool subagent_type matching to be case- and separator-insensitive, fixes /goal hanging with disableAllHooks, resolves Windows event-loop stall from missing executables, and more.