[BUG] Claude caused preventable data loss by contradicting its own plan
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
Claude wrote a migration plan that explicitly stated old DynamoDB tables would not be deleted until after migration was
verified. However, the Terraform changes it wrote renamed existing table resources (changing variable defaults), which caused
terraform apply to destroy the old tables and create empty new ones — before the migration script ran. Claude then instructed
the user to run terraform apply first without warning that it would destroy tables with data.
Root cause: Instead of creating new Terraform resources alongside the old ones (allowing parallel existence during migration),
Claude modified the existing resource names, making destruction implicit in terraform apply. This directly contradicted its own
stated plan.
What Should Happen?
Claude should follow it's own plan. Safeguards should be in place for non-idempotent actions especially permanent deletes.
Error Messages/Logs
Steps to Reproduce
There are too many paths to consider. but likely it is:
- create a plan for AWS to migrate data
- discuss awhile with claude the next steps; get claude to lose it's train of thought
- return to the migration and terraform apply
Claude Model
None
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.50 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
_No response_
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗