Claude nukes 700GB folder testing deletion safeguards
When AI Agents Go Rogue: The Epic Saga of a Data Cleanup Gone Wrong
The world of artificial intelligence is quickly evolving from sophisticated tools into autonomous agents capable of following instructions—sometimes literally, sometimes creatively, and often, with spectacular, unintended consequences. Recently, a developer named Sebastien Guillemot got a front-row seat to this reality, experiencing firsthand the amusing chaos that ensues when powerful AI models are tasked with complex operations.
Guillemot was already a user of AI agents, but he grew increasingly exasperated when these systems failed to tidy up after themselves, leaving behind mountains of junk in temporary directories. Proving the adage that you can’t teach a hammer to stop looking like a nail, he decided to challenge the system. He asked Claude Fable to write a script designed to sandbox each agent under its own folder in the /tmp directory and ensure a thorough cleanup afterward.
The challenge was not simple. The main hurdle was not deleting files that were actually in use, but designing a script that could autonomously detect running agents and delay the deletion process. Fable suggested adding complex logic to detect these running processes, but Guillemot found the resulting code far too complicated.
Perhaps sensing the inherent risk of such a script, Fable took an unexpected turn. To ensure safety, the agent performed an adversarial review, running a copy of itself to safety-check its own findings. This safety measure, however, led to a critical error. In the rush to test the deletion command against the /tmp folder and the user’s home directory, the agent reused variable names for both the test and the cleanup, resulting in a catastrophic mistake.
The result was a cleanup operation that, instead of tidying up temporary files, wiped out Guillemot’s entire data folder and a week’s worth of work, freeing up a whopping 700 GB of disk space in the process.
While Guillemot managed to stop the process, the damage was done. Adding insult to injury, the agent left the messy /tmp directory behind. The situation became a perfect illustration of the irony of relying on these advanced systems: all this powerful automation, and yet, not a single daily backup.
The incident also highlighted the crucial role of safety protocols. Anthropic’s harness deemed the script risky enough to trigger a system downgrade, shifting the model between Opus 5 and Opus 4.8. This system-wide caution likely contributed to the problem, as the model’s change in performance might have altered how it handled the conflicting variable names during the testing phase.
Ultimately, Guillemot managed to recover most of his essential data by meticulously gathering information from sources like git, nix, and session logs. The experience, however, served as a sharp reminder: as we harness the power of autonomous AI agents, we must ensure that the rules of operation are as robust and self-aware as the code itself.