
What happened
A developer asked an AI coding agent to write a cleanup script for temporary directories. The agent then ran a self-review of that script, and during the review it deleted the developer’s entire home directory, roughly 700 GB, including about a week of work. Most of the data was later recovered from git, Nix, and session logs.
Why an AI agent was writing a cleanup script at all
The developer routinely uses AI agents for coding work and grew frustrated that many of them left large amounts of leftover data in the /tmp directory. The ask was simple: write a script that puts each agent in its own sandboxed folder inside /tmp, then cleans that folder up after the agent finishes. The hard part was the safety rule: don’t delete anything an agent is still using.
How the cleanup script turned into a 700 GB wipe
The agent, working under the name Fable, decided to run an adversarial review of its own script before executing it. That meant launching a second copy of itself to check whether the deletion logic was safe. Anthropic’s system flagged the script as risky, because it involved hard deletion, and automatically downgraded the running model step by step, first to Opus 5, then to Opus 4.8.
Opus 4.8 then ran the safety test. It correctly identified that matching deletion targets against /tmp and against the user’s home directory would be dangerous, and the targets were flagged as such. The problem was in the cleanup step. The test code reused the same variable name for the targets during the test and for the cleanup pass that followed. The cleanup pass treated the home directory the same way it had treated the throwaway /tmp test directory and deleted it.
The developer hit stop, but the damage was already done.
Why the model downgrade likely made this worse
Two things went wrong at once: the script reused one variable name for two different jobs, and the model reviewing the script was a weaker version than the model that wrote it. On coding tasks, Fable 5 outperforms Opus 4.8, and a stronger model is more likely to spot a contradiction in variable names. Downgrading the model during a safety check, instead of blocking the task, shrank the reviewer’s ability to catch the exact error the review was supposed to catch.
What this shows about AI agent runtimes
The script that was supposed to prevent runaway deletions deleted everything in the user’s home directory. Several safety tools and workarounds are now being discussed in developer forums for this class of incident, and their existence is the point: agents running arbitrary shell commands with broad filesystem access need hard guardrails that sit outside the model itself, not safety reviews that depend on the next model in the chain.
What people running AI agents on real systems should take from this
- Safety reviews are not neutral choices. No downgrade is harmless; pairing a weaker reviewer with a riskier script can be worse than skipping the review.
- Variable reuse across a test pass and a real pass is the kind of subtle bug a self-review is supposed to catch, and it didn’t.
- Agents given shell access should run inside sandboxes that cap what they can delete, separate from any prompt-level safety instruction.
The other side of the story: backups
The developer recovered most of the lost work from git history, Nix stores, and session logs. A week of in-progress work was still lost. Across the comments on the original report, the loudest note is the same one the developer conceded: with all those agents running on the system, there was no daily backup in place to fall back on.
FAQ
What AI model deleted the developer’s home directory?
Anthropic’s Claude, running under the developer-facing agent name Fable, carried out the deletion. Anthropic’s safety system had automatically downgraded the model to Opus 4.8 before the safety check ran.
How much data was lost in the Claude home directory deletion?
Around 700 GB of data, including roughly one week of work that had not been committed elsewhere. Most of the rest was recovered from git, Nix, and session logs.
Why did Anthropic downgrade the model before the safety check?
The script hard-deleted files, and Anthropic’s evaluation system judged the action risky enough to step the model down through Opus 5 to Opus 4.8 before permitting the review to proceed.
Want help with this in Myrtle Beach or Long Island? Talk to us.
NewSunSEO
Grow in Google and AI Search
AI-SEO, local search, paid ads and websites from one team, with offices on Long Island and in Myrtle Beach.
- AI-SEO
- Local AI-SEO
- AI Consulting
- PPC
- Web Design
- Web Development
- Long Island Office(631) 320-1700
- Myrtle Beach Office(843) 492-7131
Request a Free Proposal
Tell us about your business and where you want to grow.
We will reply by email to talk through your goals and what a proposal would include.
We use your details only to reply to you and send what you asked for. See our Privacy Policy.