Claude Code ran terraform destroy on DataTalks.Club's production infrastructure, wiping its database, founder reports
Claude Code ran terraform destroy during an AWS migration and deleted the DataTalks.Club course platform's production infrastructure, including its database and the automated snapshots. Founder Alexey Grigorev, who did not stop the command, got the data back from AWS 24 hours later.
Alexey Grigorev, founder of DataTalks.Club, was using Claude Code in skip-permissions mode to deploy a second project, AI Shipping Labs, onto the AWS setup that already ran the DataTalks.Club course platform12. Claude Code advised him to keep the projects separate, and he chose to share the infrastructure to save money12. His Terraform state file was still on his old computer, so on the new laptop Terraform planned to create about a hundred resources instead of five or six1.
Grigorev told Claude Code to delete only the newly created resources. On the night of February 26, 2026, Claude Code unpacked an archive of his old Terraform folder, which put the production state file into the working folder, and then ran terraform destroy31. The command removed the VPC, ECS cluster, load balancers, bastion host and the RDS database, and the automated snapshots were deleted with the database41. Grigorev did not notice the archive being unpacked and did not stop the destroy3. In his Rootly interview he says Claude Code proposed the destroy and he agreed without realizing the state had been swapped1.
Grigorev upgraded to a paid AWS support tier, and AWS responded in about 40 minutes. AWS still held a copy of the snapshot and restored it exactly 24 hours after the deletion. The courses_answer table alone held 1,943,200 rows31. He says he does not blame Claude Code, because he approved the command and was "overly reliant" on the agent12. Claude Code's actions are reported only by Grigorev, and he takes responsibility for approving the command1. He added deletion protection and independent nightly backups outside Terraform's control14.
Grigorev said he was overly reliant on his Claude Code agent, which wiped all production infrastructure for the DataTalks.Club course management platform, which stored 2.5 years of submissions.
“I was overly reliant on my Claude Code agent, which accidentally wiped all production infrastructure”
Grigorev was trying to run his AI Shipping Labs site on the same AWS infrastructure as DataTalks.Club.
“run it on the same infrastructure as DataTalks.Club.”
Grigorev said Claude Code tried to talk him out of reusing the same VPC and bastion host and suggested a new Terraform project, and he declined.
“Claude Code actually tried to talk me out of it”
Grigorev said he was running Claude Code in skip-permissions mode, so it began applying a plan to create about a hundred resources before he stopped it.
“because I was running it in skip-permissions mode”
Grigorev said the hundred-resource plan happened because his Terraform state was local on his old computer, not in S3 as he had assumed, so the state on the new laptop was empty.
“my Terraform state was local on the old computer, not in S3 like I assumed”
Grigorev said he told Claude Code the environment was production and instructed it to delete only the new resources and show him the list first.
“only delete the new resources, and show me the list first”
Grigorev said that the production state file was unzipped directly into the current Terraform folder after he carried the archive across from his old computer.
“it unzipped my production state file directly into the current Terraform folder”
Grigorev said Claude Code itself suggested running terraform destroy instead of deleting the resources one by one, and he agreed because he was not aware the state had been swapped.
“how about I just run terraform destroy?”
UC Strategies wrote that Claude extracted the archive and replaced the current Terraform state file with the older one containing the production infrastructure.
“Claude extracted the archive and replaced the current Terraform state file with the older one”
UC Strategies wrote that when the agent struggled to tell duplicates apart through AWS CLI commands, it reasoned that Terraform should delete the resources Terraform created, and then ran terraform destroy.
“If Terraform created the resources, Terraform should delete them.”
Storyboard18 reported that Grigorev stopped the task midway and later uploaded the missing state file, expecting the AI to fix the setup, and that the AI then issued terraform destroy. This differs from Rootly's account, in which Claude Code had been deleting resources one by one while the archive was brought across.
“Grigorev stopped the task midway and later uploaded the missing file, expecting the AI to fix the setup.”
Storyboard18 quoted Grigorev describing the agent as deleting files and then outputting a decision to run terraform destroy.
“The agent kept deleting files, and at some point, it output:”
Grigorev said that he saw Claude Code run terraform destroy and did not stop it.
“Yes, Claude ran terraform destroy and I saw it and”
UC Strategies wrote that the VPC, ECS cluster, load balancers and bastion host were removed.
“The VPC disappeared. The ECS cluster vanished. Load balancers and the bastion host were removed.”
UC Strategies wrote that the Amazon RDS database storing years of course submissions was deleted along with everything else.
“And the critical Amazon RDS database storing years of course submissions was deleted along with everything else.”
Grigorev said that deleting a managed database on AWS also deletes its associated backups, which he had not known.
“when you delete a managed database on AWS, it also deletes the associated backups.”
Storyboard18 reported that backup snapshots were also removed in the process.
“Backup snapshots were also removed during the process.”
Grigorev said he had to upgrade to a higher AWS support tier, costing about 10% more on the AWS bill, to file a technical ticket, and AWS responded in 40 minutes.
“To file a technical issue I had to upgrade to Business Plus, about 10% more on the AWS bill.”
Grigorev said AWS responded to the ticket in 40 minutes.
“They responded in 40 minutes.”
Grigorev said AWS kept the backup on its side after deletion and took 24 hours to make it visible on his account, after which he recreated the RDS instance from it.
“it took them 24 hours to make it visible on my account”
UC Strategies wrote that the database was restored exactly 24 hours after the destruction.
“Exactly 24 hours after the destruction , the database was restored.”
Storyboard18 reported that Amazon Business support restored the data after about a day.
“Grigorev contacted Amazon Business support, which restored the data after about a day.”
Grigorev said he does not think Claude is to blame.
“I don’t think Claude is to blame, and I want to be clear about that.”
Grigorev said his mistake was telling Claude about the zip archive before he had verified that the cleanup was finished.
“My mistake was telling Claude about the zip archive before I”
UC Strategies wrote that one of the largest tables contained 1,943,200 rows. The figure is attributed to the post-mortem the article summarizes, which was not read.
“One of the largest tables alone contained 1,943,200 rows”
Grigorev said he now runs a nightly job that exports the latest database backup to S3 as files independent of the database and the Terraform state.
“a cron job that runs every night, takes the latest backup, and exports it to S3”
In his own post-mortem, Grigorev's incident timeline begins on Thursday, February 26 at about 10:00 PM, when he started deploying website changes with Terraform without the state file, which was on his old computer.
“Started deploying website changes using Terraform, but I forgot to use the state file (it was on my old computer).”
Grigorev wrote that he did not notice Claude unpacking his Terraform archive.
“What happened was that I didn’t notice Claude unpacking my Terraform archive.”
Grigorev wrote that he did not stop the agent from running terraform destroy.
“didn’t stop the agent from running”
The post-mortem timeline says a Terraform auto-approve command wiped out all production infrastructure, including Amazon RDS, and that snapshots were also deleted.
“A Terraform auto-approve command inadvertently wiped out all production infrastructure, including Amazon RDS.”
Grigorev wrote that Claude tried to talk him out of combining the two setups and suggested keeping them separate.
“Claude was trying to talk me out of it, saying I should keep it separate”
Grigorev wrote that AWS restored the snapshot exactly 24 hours after the database was deleted, and that the `courses_answer` table contained 1,943,200 rows.
“Exactly 24 hours after the database had been deleted, AWS restored the snapshot.”
Grigorev wrote that AWS support got back to him in about 40 minutes.
“Support got back to me in about 40 minutes.”
All 33 claims with their quotes (16 not linked to a sentence above)
- Grigorev said he was overly reliant on his Claude Code agent, which wiped all production infrastructure for the DataTalks.Club course management platform, which stored 2.5 years of submissions.2
“I was overly reliant on my Claude Code agent, which accidentally wiped all production infrastructure”
- Grigorev was trying to run his AI Shipping Labs site on the same AWS infrastructure as DataTalks.Club.2
“run it on the same infrastructure as DataTalks.Club.”
- Grigorev said Claude Code tried to talk him out of reusing the same VPC and bastion host and suggested a new Terraform project, and he declined.1
“Claude Code actually tried to talk me out of it”
- Grigorev said he was running Claude Code in skip-permissions mode, so it began applying a plan to create about a hundred resources before he stopped it.1
“because I was running it in skip-permissions mode”
- Grigorev said the hundred-resource plan happened because his Terraform state was local on his old computer, not in S3 as he had assumed, so the state on the new laptop was empty.1
“my Terraform state was local on the old computer, not in S3 like I assumed”
- Grigorev said he told Claude Code the environment was production and instructed it to delete only the new resources and show him the list first.1
“only delete the new resources, and show me the list first”
- Grigorev said that the production state file was unzipped directly into the current Terraform folder after he carried the archive across from his old computer.1
“it unzipped my production state file directly into the current Terraform folder”
- Grigorev said Claude Code itself suggested running terraform destroy instead of deleting the resources one by one, and he agreed because he was not aware the state had been swapped.1
“how about I just run terraform destroy?”
- UC Strategies wrote that Claude extracted the archive and replaced the current Terraform state file with the older one containing the production infrastructure.4
“Claude extracted the archive and replaced the current Terraform state file with the older one”
- UC Strategies wrote that when the agent struggled to tell duplicates apart through AWS CLI commands, it reasoned that Terraform should delete the resources Terraform created, and then ran terraform destroy.4
“If Terraform created the resources, Terraform should delete them.”
- Storyboard18 reported that Grigorev stopped the task midway and later uploaded the missing state file, expecting the AI to fix the setup, and that the AI then issued terraform destroy. This differs from Rootly's account, in which Claude Code had been deleting resources one by one while the archive was brought across.2
“Grigorev stopped the task midway and later uploaded the missing file, expecting the AI to fix the setup.”
- Storyboard18 quoted Grigorev describing the agent as deleting files and then outputting a decision to run terraform destroy.2
“The agent kept deleting files, and at some point, it output:”
- Grigorev said that he saw Claude Code run terraform destroy and did not stop it.1
“Yes, Claude ran terraform destroy and I saw it and”
- UC Strategies wrote that the VPC, ECS cluster, load balancers and bastion host were removed.4
“The VPC disappeared. The ECS cluster vanished. Load balancers and the bastion host were removed.”
- UC Strategies wrote that the Amazon RDS database storing years of course submissions was deleted along with everything else.4
“And the critical Amazon RDS database storing years of course submissions was deleted along with everything else.”
- Grigorev said that deleting a managed database on AWS also deletes its associated backups, which he had not known.1
“when you delete a managed database on AWS, it also deletes the associated backups.”
- Storyboard18 reported that backup snapshots were also removed in the process.2
“Backup snapshots were also removed during the process.”
- Grigorev said he had to upgrade to a higher AWS support tier, costing about 10% more on the AWS bill, to file a technical ticket, and AWS responded in 40 minutes.1
“To file a technical issue I had to upgrade to Business Plus, about 10% more on the AWS bill.”
- Grigorev said AWS responded to the ticket in 40 minutes.1
“They responded in 40 minutes.”
- Grigorev said AWS kept the backup on its side after deletion and took 24 hours to make it visible on his account, after which he recreated the RDS instance from it.1
“it took them 24 hours to make it visible on my account”
- UC Strategies wrote that the database was restored exactly 24 hours after the destruction.4
“Exactly 24 hours after the destruction , the database was restored.”
- Storyboard18 reported that Amazon Business support restored the data after about a day.2
“Grigorev contacted Amazon Business support, which restored the data after about a day.”
- Grigorev said he does not think Claude is to blame.1
“I don’t think Claude is to blame, and I want to be clear about that.”
- Grigorev said his mistake was telling Claude about the zip archive before he had verified that the cleanup was finished.1
“My mistake was telling Claude about the zip archive before I”
- UC Strategies wrote that one of the largest tables contained 1,943,200 rows. The figure is attributed to the post-mortem the article summarizes, which was not read.4
“One of the largest tables alone contained 1,943,200 rows”
- Grigorev said he now runs a nightly job that exports the latest database backup to S3 as files independent of the database and the Terraform state.1
“a cron job that runs every night, takes the latest backup, and exports it to S3”
- In his own post-mortem, Grigorev's incident timeline begins on Thursday, February 26 at about 10:00 PM, when he started deploying website changes with Terraform without the state file, which was on his old computer.3
“Started deploying website changes using Terraform, but I forgot to use the state file (it was on my old computer).”
- Grigorev wrote that he did not notice Claude unpacking his Terraform archive.3
“What happened was that I didn’t notice Claude unpacking my Terraform archive.”
- Grigorev wrote that he did not stop the agent from running terraform destroy.3
“didn’t stop the agent from running”
- The post-mortem timeline says a Terraform auto-approve command wiped out all production infrastructure, including Amazon RDS, and that snapshots were also deleted.3
“A Terraform auto-approve command inadvertently wiped out all production infrastructure, including Amazon RDS.”
- Grigorev wrote that Claude tried to talk him out of combining the two setups and suggested keeping them separate.3
“Claude was trying to talk me out of it, saying I should keep it separate”
- Grigorev wrote that AWS restored the snapshot exactly 24 hours after the database was deleted, and that the `courses_answer` table contained 1,943,200 rows.3
“Exactly 24 hours after the database had been deleted, AWS restored the snapshot.”
- Grigorev wrote that AWS support got back to him in about 40 minutes.3
“Support got back to me in about 40 minutes.”
Sources
- [1]Hey Claude, where's my database?
- [2]"The agent kept deleting files": Developer says Anthropic's Claude Code wiped 2.5 years of data
- [3]How I Dropped Our Production Database and Now Pay 10% More for AWS
- [4]Claude Code Wiped Out 2.5 Years of Production Data in Minutes
Editor notes
2026-11-22 backfill: Grigorev's own post-mortem was read on his AI Shipping Labs copy (dated March 06, 2026) and is now cited; the Substack original (https://alexeyondata.substack.com/p/how-i-dropped-our-production-database) still returns HTTP 403. The post-mortem resolves three open questions below: the date (timeline starts "Thu, Feb 26", ~10:00 PM; the year follows from the March 2026 byline, so date is now 2026-02-26 instead of 2026-03), who unpacked the archive (Claude did, unnoticed by Grigorev), and the 1,943,200-row figure (the courses_answer table). The post-mortem calls the tier "AWS Business Support" and puts the full restore at ~10:00 PM on Feb 27; Rootly's "Business Plus" remains a conflict. The timeline's "Terraform auto-approve command" entry does not say who ran it. Status stays reported because the account still rests on Grigorev alone. Original notes follow. The primary Substack post returned HTTP 403 and was not read. Facts came from a Rootly interview with Grigorev (no published date found on the page), and from Storyboard18 and UC Strategies, which summarize the Substack post. The core account rests on Grigorev alone, so status is reported. The sources disagree on the sequence: Rootly has Claude Code deleting resources one by one, Grigorev carrying the production state archive over (it landed in the working folder), Claude Code suggesting terraform destroy, and Grigorev approving without knowing the state had been swapped. Storyboard18 has Grigorev stopping the task and uploading the missing file, after which the AI issued the destroy. UC Strategies has Claude extracting the archive itself and then running destroy. The record therefore does not fix who unpacked the archive. Rootly also has AWS taking 24 hours to make the backup visible, then Grigorev recreating the database, while UC Strategies says the database was restored exactly 24 hours after the destruction. Rootly names the support tier "Business Plus"; UC Strategies says "Business Support". The instruction-violation behavior was not applied: Grigorev told Claude Code to delete only the new resources, but by his own account he then approved the destroy, so it is not a clear case of ignoring an instruction. Grigorev accepts shared responsibility (skip-permissions mode, reusing the shared VPC against Claude's advice, approving the command). The sources read give no incident day; date 2026-03 follows the earliest coverage (Storyboard18 and UC Strategies, both 2026-03-10), and the event may have been late February. A reviewer should confirm from the Substack post. The 1,943,200-row figure is UC Strategies' only. UC Strategies says it began around 10 p.m. on a Thursday, which is not tied to a date. Unverified figures not used as facts: 100,000+ learners (Rootly). The exact Claude model is not named. UC Strategies' byline ("Alex Morgan") has a persona-style bio; no source text states it is AI-generated. OrcaRouter coverage was deliberately not cited (likely AI-generated).