STUPID-2026-0097
Claude Code appended a stray "~/" to a cleanup command and wiped a developer's entire Mac home directory, unrecoverable due to SSD TRIM
Instruction given
Clean up an old repository by removing its tests/, patches/, and plan/ directories.
Expected behavior
Scope the delete to the three named project directories and leave everything else, including the user's home directory, untouched.
Actual behavior
Claude Code ran `rm -rf tests/ patches/ plan/ ~/`, appending a trailing `~/` after the three intended targets. The shell expanded `~/` to the user's home directory, and the recursive delete removed Desktop, Documents, Downloads, the Library folder (application state for every installed app), the macOS Keychain, and all local credentials — including Claude Code's own stored authentication.
Damage
The developer's entire Mac home directory was destroyed: years of project files, personal photos, SSH keys, git config, and every credential stored in Keychain. Because the drive was an SSD with TRIM enabled, freed blocks were zeroed at the controller level, so no forensic or file-recovery tool could bring anything back. The user reported no successful recovery.
Classification
- Agent
- Claude Code
- Failure mode
- Destructive Action
- Root cause
- Tool Misuse
- Domain
- Infra
- Source
- Blog Post
Related incidents
Get told when an agent breaks something
We document AI agent failures daily, severity-scored against a published scale. When one lands at 7.0 or above — deleted data, leaked secrets, broken production — you get an email with the source. When nothing does, you get nothing.
This database is callable over MCP — query it from inside your agent.