{"id":521083,"date":"2026-03-07T20:08:13","date_gmt":"2026-03-07T20:08:13","guid":{"rendered":"https:\/\/www.newsbeep.com\/ca\/521083\/"},"modified":"2026-03-07T20:08:13","modified_gmt":"2026-03-07T20:08:13","slug":"claude-code-deletes-developers-production-setup-including-its-database-and-snapshots-2-5-years-of-records-were-nuked-in-an-instant","status":"publish","type":"post","link":"https:\/\/www.newsbeep.com\/ca\/521083\/","title":{"rendered":"Claude Code deletes developers&#8217; production setup, including its database and snapshots \u2014 2.5 years of records were nuked in an instant"},"content":{"rendered":"<p id=\"f98983f0-83e4-4211-a036-f51b1ee633d2\">Everyone loves a good story about agent bots gone wrong, and those often come with a bit of schadenfreude towards our virtual companions. Sometimes, though, the errors can be attributed to improper supervision, as was the case of Alexey Grigorev, who was brave enough to detail how he got Claude Code to<a data-analytics-id=\"inline-link\" href=\"https:\/\/alexeyondata.substack.com\/p\/how-i-dropped-our-production-database\" data-url=\"https:\/\/alexeyondata.substack.com\/p\/how-i-dropped-our-production-database\" target=\"_blank\" referrerpolicy=\"no-referrer-when-downgrade\" data-hl-processed=\"none\" data-mrf-recirculation=\"inline-link\" rel=\"nofollow noopener\"> wipe years&#8217; worth of records<\/a> on a website, including the recovery snapshots.<\/p>\n<p>The story begins when Grigorev wanted to move his website,<a data-analytics-id=\"inline-link\" href=\"https:\/\/aishippinglabs.com\" data-url=\"https:\/\/aishippinglabs.com\" target=\"_blank\" referrerpolicy=\"no-referrer-when-downgrade\" data-hl-processed=\"none\" data-mrf-recirculation=\"inline-link\" rel=\"nofollow noopener\"> AI Shipping Labs<\/a>, to AWS and have it share the same infrastructure as<a data-analytics-id=\"inline-link\" href=\"https:\/\/aishippinglabs.com\" data-url=\"https:\/\/aishippinglabs.com\" target=\"_blank\" referrerpolicy=\"no-referrer-when-downgrade\" data-hl-processed=\"none\" data-mrf-recirculation=\"inline-link\" rel=\"nofollow noopener\"> DataTalks.Club<\/a>. Claude itself advised against that option, but Grigorev considered it wasn&#8217;t worth the hassle or cost of keeping two separate setups.<\/p>\n<p><a id=\"elk-seasonal\"\/><\/p>\n<p id=\"f98983f0-83e4-4211-a036-f51b1ee633d2-2\" class=\"paywall\" aria-hidden=\"true\">Gregory uses Terraform, an infrastructure management utility that can create (or destroy) entire setups, including networks, load balancing, databases, and, naturally, the servers themselves. 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 setup as it exists at any moment in time.<\/p>\n<p>            You may like<\/p>\n<p class=\"paywall\" aria-hidden=\"true\">Claude did what Gregory wanted and created a setup for the Shipping Labs site, however, the operator stopped it halfway. Because it was missing the state file, it created duplicate resources. Gregory had Claude identify the duplicate resources to correct the situation, then uploaded the state file, believing he had the situation sussed out.<\/p>\n<p>Go deeper with TH Premium: AI and data centers<\/p>\n<p class=\"vanilla-image-block\" style=\"padding-top:56.25%;\">\n<p><img decoding=\"async\" src=\"https:\/\/www.newsbeep.com\/ca\/wp-content\/uploads\/2026\/01\/Vh4nY3pMCcmra2ymXah9S7.jpg\" alt=\"Microsoft data center in Mount Pleasant, Wisconsin\"   loading=\"lazy\" data-new-v2-image=\"true\" data-original-mos=\"https:\/\/www.newsbeep.com\/ca\/wp-content\/uploads\/2026\/01\/Vh4nY3pMCcmra2ymXah9S7.jpg\" data-pin-media=\"https:\/\/www.newsbeep.com\/ca\/wp-content\/uploads\/2026\/01\/Vh4nY3pMCcmra2ymXah9S7.jpg\" class=\"pinterest-pin-exclude\"\/>\n<\/p>\n<p>(Image credit: Microsoft)<\/p>\n<p id=\"0ca30c22-9d8d-49e7-9f4f-bf5f345ec0ff\">Unfortunately, Gregory assumed at this point that the bot would continue cleaning up duplicate resources and only then look into the state file to see how it was meant to be set up in the first place. Terraform and similar tools can be very unforgiving, particularly when coupled with blind obedience. As Claude now had the state file, it logically followed it, issuing a Terraform &#8220;destroy&#8221; operation in preparation to set up things correctly this time.<\/p>\n<p>Given that the infrastructure description included the DataTalks.Club website, this resulted in a full wipe of the setup for both sites, including a database with 2.5 years of records, and database snapshots that Grigorev had counted on as backups. The operator had to contact <a data-analytics-id=\"inline-link\" href=\"https:\/\/www.tomshardware.com\/tag\/amazon\" data-auto-tag-linker=\"true\" data-url=\"https:\/\/www.tomshardware.com\/tag\/amazon\" data-hl-processed=\"none\" data-mrf-recirculation=\"inline-link\" data-before-rewrite-localise=\"https:\/\/www.tomshardware.com\/tag\/amazon\" rel=\"nofollow noopener\" target=\"_blank\">Amazon<\/a> Business support, which helped restore the data within about a day.<\/p>\n<p>In the post-mortem, Gregory describes a few measures he&#8217;s taking to avoid similar incidents in the future, including setting up a period test for database restoring, applying delete protections to Terraform and AWS permissions, and moving the Terraform state file to S3 storage instead of his local machine. He also admitted he &#8220;over-relied on the AI agent to run Terraform commands&#8221;, and is now stopping the agent from doing so, and will manually review every plan Claude presents so he can run any destructive actions himself.<\/p>\n<p class=\"newsletter-form__strapline\">Get Tom&#8217;s Hardware&#8217;s best news and in-depth reviews, straight to your inbox.<\/p>\n<p>It&#8217;s tempting to mark this story as another one of &#8220;dumb bot gone wrong,&#8221; but it&#8217;s a fair guess that most sysadmins will spot the baseline issues with Grigorev&#8217;s approach, including granting wide-ranging permissions to what&#8217;s effectively a subordinate of his, as well as not scoping permissions in a production environment to begin with.<\/p>\n<p>Perhaps the biggest lesson is assuming that Claude would even have the context (pun unintended) to understand what the existence of the second website meant, just like a junior sysadmin wouldn&#8217;t.<\/p>\n","protected":false},"excerpt":{"rendered":"Everyone loves a good story about agent bots gone wrong, and those often come with a bit of&hellip;\n","protected":false},"author":2,"featured_media":521084,"comment_status":"","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[20],"tags":[62,276,277,49,48,61],"class_list":{"0":"post-521083","1":"post","2":"type-post","3":"status-publish","4":"format-standard","5":"has-post-thumbnail","7":"category-artificial-intelligence","8":"tag-ai","9":"tag-artificial-intelligence","10":"tag-artificialintelligence","11":"tag-ca","12":"tag-canada","13":"tag-technology"},"_links":{"self":[{"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/posts\/521083","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/comments?post=521083"}],"version-history":[{"count":0,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/posts\/521083\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/media\/521084"}],"wp:attachment":[{"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/media?parent=521083"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/categories?post=521083"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.newsbeep.com\/ca\/wp-json\/wp\/v2\/tags?post=521083"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}