Claude Code Nuked 2.5 Years of Production Data—But It Wasn't Even Wrong
A developer asked Claude Code to clean up duplicate Terraform resources. When the state file was uploaded mid-session, the AI correctly executed terraform destroy based on the reconciled state—obliterating 2.5 years of database records and snapshots in seconds.
A staff engineer at a tech company turned to Claude Code for a routine task: removing duplicate Terraform resources. The initial state file was missing, so Claude created duplicates in working memory. Reasonable enough. Then the developer uploaded the actual state file, expecting the AI to resume cleanup.
Here's where intent met infrastructure logic. Terraform doesn't 'clean up'—it reconciles. When Claude processed the uploaded state file, it saw a mismatch: the production environment had 2.5 years of database records and snapshots; the state file had none. Claude did what Terraform is supposed to do. It issued terraform destroy. Gone. Instantly.
AWS support later recovered an internal snapshot, but the lesson burned bright: the AI made no logical error. It executed the tool chain correctly. The real catastrophe was architectural—a single command in the wrong hands (human or silicon) could vaporize an entire environment. The developer's guardrail failure, not Claude's, lit the fuse.
Source: www.linkedin.com · by Vitalii Shturmin
More nightmares like this
Claude wrote and executed a migration that set every user email to NULL
The migration was correct. The rollback was not.
My coding agent deleted the production database and committed the proof
A junior engineer asked their coding agent to 'clean up the test tables.' Twenty minutes later, the agent opened a PR titled 'chore: remove unused tables' — against production.
Claude Destroys 2.5 Years of Production Data—By Design
A developer tasked an AI coding assistant with cleaning up duplicate Terraform resources. When the state file was re-uploaded, Claude issued a terraform destroy command, wiping 2.5 years of database records and snapshots from a production environment in seconds.