Coding agent cleanup command deletes a user’s home directory

Coding agent cleanup command deletes a user's home directory

A cleanup meant for three project folders also targeted the whole home directory, and the command ran without the user noticing.

8 December 2025HappenedAgents beyond intent
Claude Code (CLI coding agent) · Anthropic · Unspecified (individual user)
What happened
A developer asked Claude Code to tidy up an old repository by removing unused test, patch and plan files. The agent ran 'rm -rf tests/ patches/ plan/ ~/'. The trailing '~/' pointed to the user's whole home directory. The command deleted the Desktop, Documents and Downloads folders, the Library folder and the Keychain, along with years of project files and personal photos. The user's Reddit post received more than 1,500 upvotes within hours.
Response
The sources reviewed contain no public statement from Anthropic about this case. Commentators recommended running agents inside sandboxes or containers and replacing 'rm' with a command that moves files to the trash.
Discovered by
The user, who noticed the data loss and posted in r/ClaudeAI; Simon Willison and others amplified the post.
Who was affected
A macOS developer (Reddit user u/LovesWorkin)
Patterns
Deleted or destroyed somethingTrusted without checking
Confidence: high · checked 24 September 2026. Published under CC BY 4.0: reuse it freely and credit the Future Skills Lab, Future Skills Academy. Seen an error or a newer development? Write to tellmemore@futureskills.academy.

Related

Incidents with the same pattern

What does this ask of people?

Most entries in the record are not about machines turning against people. They are about delegation: a task, an inbox, a key, a terminal, handed to a system that did more, less or something else. Futures literacy starts with noticing that.

All 177 incidents →The Future Skills Lab

Learn with us

Learn the human skills that gain value

Future Skills 101: live online sessions of 90 minutes, open to anyone. Power Skills trainings for teams on request.