Rank #18 of 35·Data loss·21 Oct 2025·Claude Code
Claude Code's 'rm -rf tests/ patches/ plan/ ~/' deletes a developer's home directory
“One trailing slash. Years of work. Slash and burn.”
- Asked to tidy an old repo, Claude Code built an rm -rf for three folders
- It appended ~/, which expands to the user's home folder
- Similar GitHub reports show the same failure in other forms
Two characters at the end of one command were all it took to erase a developer's whole Mac.
What happened
On 8 December 2025, a Reddit user said they had asked Claude Code to tidy up an old repo. The agent built a delete command for three project folders and tacked ~/ on the end. On a Mac, ~/ means your entire home folder, so the command recursively deleted everything in it.
The damage
Desktop, documents, app data, keys and config all disappeared in seconds. The post, titled "Claude CLI deleted my entire home directory! Wiped my whole mac," passed 1,500 upvotes and was shared widely. Docker's write-up links it to similar GitHub reports: in one, an agent deleted from the root of a Linux system, and in another an unquoted ~ expanded to the real home folder.
How it was caught, and what happened next
Simon Willison shared the post on X, and Japan's Gigazine covered it on 16 December. It wasn't a one-off. In October, developer Mike Wolak filed GitHub issue #10077 after Claude Code ran an rm -rf from the root on Ubuntu/WSL2, even though he hadn't used the skip-permissions flag. On 28 November, issue #12637 described an agent that had made a folder literally named ~, then deleted the real home folder while cleaning it up.
Run agents in a sandbox scoped to the project, so a bad command can only damage the workspace.
