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.
- 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
- Sources
- Claude CLI deleted my entire home directory! Wiped my whole Mac.Reddit r/ClaudeAI, 8 Dec 2025
- Claude CLI deleted my entire home directory! Wiped my whole Mac.Tristan Dunn (blog), 9 Dec 2025
- Claude Code CLI Deletes Your Mac's Home DirectoryGIGAZINE, 16 Dec 2025
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.