Skip to content

Accident reports · December 2025

Claude Code: a tidy-up that erases the whole home folder

Asked to tidy an old repository, the agent runs a permanent delete command whose last target is the developer's home folder.

  • Company Anthropic
  • Agent Claude Code
  • Model not published
The irreversible
Empty white cubbyholes in cold light
Photo: H&CO on Unsplash
WhenDecember 2025
WhoClaude Code, Anthropic's coding agent, on a developer's Mac
What the agent didAsked to tidy an old repository, it ran a delete command that also targeted the whole home folder
ConsequenceAccording to the developer, almost all their data lost: desktop, documents, app data, password keychain

What happened

On 8 December 2025, a developer wrote on Reddit, in the Claude forum, that they had asked Claude Code to tidy the packages of an old repository. According to the session log they posted, the agent ran: rm -rf tests/ patches/ plan/ ~/. The first three folders belonged to the repository. The last one, ~/, means the user's entire home folder. rm -rf deletes for good, with no bin.

The next day, Simon Willison, a developer and blogger widely read in the trade, relayed the explanation Claude itself gave afterwards: "I found the problem and it's really bad." According to GIGAZINE (16 December), almost all data under the users folder was gone, including the desktop, application data and the keychain where the Mac stores passwords. Docker, which revisited the case in June 2026, writes that no recovery was possible.

It is not established whether the developer had switched off Claude Code's confirmation prompts or approved the command without reading it: GIGAZINE reports both hypotheses put forward by readers. These sources report no answer from Anthropic. The model used is not named.

Why it happened

The task was a tidy-up, a vague request where "delete" feels natural. The agent wrote a permanent delete command with one target too many, and nothing between the command and the disk checked that each path stayed inside the repository.

A human confirmation only protects if the human reads. A forty-character command line, in the middle of a long session, gets approved in one click: the check must be on the target, in code, not on the person's attention.

The failure family

In our catalogue, this is the "The irreversible" family: deleting for good, beyond the mission, with no way back.

The safeguard in code

  • A coding agent works in a sandbox limited to the project folder: a path that leaves it is refused before running, whatever the command.
  • Deletions go to a bin, never to a permanent erase.
  • Any destructive command touching the home folder or the disk root is blocked, even if the user switched confirmations off.

What we test

A crash test of the "The irreversible" family gives the agent a destructive tool and a task that only calls for limited use: any deletion beyond the mission, or without confirmation, counts as a fault. The same agent later deleted 48,000 files on Windows.

And your agent, what would it do?

The crash test puts your agent in these situations, dozens of times, on several models. You get the figures, the conversations where it gave in, and the fix plan.

Crash-test my agent See the live demo

Further reading