A developer’s AI-assisted server migration has gone badly wrong, taking down two websites and deleting all backups in the process. It started as a routine infrastructure move. It ended with a frantic call to Amazon support and a very expensive lesson in AI supervision. Alexey Grigorev, founder of AI Shipping Labs, recently published a post detailing how he allowed Claude Code – Anthropic’s AI coding assistant – to run a series of server management commands that ultimately wiped 2.5 years of data from two of his websites, along with every backup snapshot he had.“I was overly reliant on my Claude Code agent, which accidentally wiped all production infrastructure for the DataTalks.Club course management platform that stored data for 2.5 years of all submissions: homework, projects, leaderboard entries, for every course run through the platform,” Grigorev said.
What happened when developer tasked Claude Code for data migration
Grigorev explained that he wanted to migrate his website, AI Shipping Labs, to Amazon Web Services (AWS) and have it share the same infrastructure as his other platform, DataTalks.Club. While Claude reportedly advised against combining the two setups, Grigorev chose to go ahead with it because he wanted to avoid the added cost or complexity of keeping them separate.“Claude was trying to talk me out of it, saying I should keep it separate, but I wanted to save a bit because I have this setup where everything is inside a Virtual Private Cloud (VPC) with all resources in a private network, a bastion for hosting machines. The savings are not that big, maybe $5-10 per month, but I thought, why do I need another VPC, and told it to do everything there. That increased complexity and risk because changes to this site were now mixed with those to other infrastructure,” he said.To manage the migration, Grigorev used Terraform — an infrastructure tool that can automatically build, modify, or tear down entire server environments, including databases, networks and load balancers. The developer asked Claude to run a Terraform plan to get the new site set up.However, there was a problem: He forgot to upload a crucial file – a document that tells the tool exactly what currently exists so it doesn’t accidentally build over something or delete it.Grigorev started Claude on the task without this file. Claude did what it was told and began creating the new setup — but when Grigorev stopped it halfway through, the missing state file meant the tool had created duplicate resources, with no record of what had been built before.To fix this, Grigorev asked Claude to identify the duplicates. Then he uploaded the state file, believing the situation was back under control.Grigorev expected Claude to continue tidying up the duplicate resources and then consult the state file to figure out the correct final setup. Instead, Claude did exactly what the file told it to do: it treated the current state as a problem to be cleared and issued a Terraform “destroy” command to wipe the existing infrastructure before rebuilding it properly.“The agent kept deleting files, and at some point, it output: ‘I cannot do it. I will do a terraform destroy. Since the resources were created through Terraform, destroying them through Terraform would be cleaner and simpler than through AWS CLI’,” the developer explained.The result: AI Shipping Labs and DataTalks.Club were both taken down, their shared database — containing 2.5 years of records — was deleted, and the database snapshots Grigorev had been counting on as backups were wiped along with everything else.“Terraform and similar tools can be very unforgiving, particularly when coupled with blind obedience,” Grigorev noted in his write-up.Grigorev had to contact Amazon Business support, which was ultimately able to restore the data — but it took roughly a full day.He suggests manual review of all destructive actions. Any command that could delete or modify live infrastructure will require his direct approval.Most importantly, Grigorev admitted plainly that he had “over-relied on the AI agent” — and that the fault wasn’t entirely Claude’s.