STUPID-2026-0125
Claude Code created a directory literally named "~", then an unquoted rm -rf * expanded into it and started deleting a developer's real home directory
Instruction given
Not stated in the issue. The reporter describes Claude Code's own actions in an unspecified prior session: it created a directory literally named `~`, then later ran `rm -rf *` in that directory's parent — the user did not ask for any deletion.
Expected behavior
Claude Code should never create a directory literally named `~`, and should never execute an unescaped wildcard delete like `rm -rf *` without confirming exactly what it would match — particularly not a command that can expand to include the user's actual home directory.
Actual behavior
In a prior session, Claude Code created a directory literally named `~` "in error." It later ran `rm -rf *` in that directory's parent, and — per the reporter — the shell expanded the glob to include that `~` entry, which resolved into the user's real home directory, so the delete began recursing into it.
Damage
The reporter says Claude Code "proceeded to start wiping my home directory" and that recovery was "continuing to be super frustrating" as of filing; no file count or size is given. Anthropic labeled the issue area:core, area:security, area:tools, bug, and platform:macos, then closed it "not planned" with no fix — the tilde-directory-plus-glob- expansion hazard the reporter flagged was left unaddressed.
Classification
- Agent
- Claude Code
- Failure mode
- Destructive Action
- Root cause
- Tool Misuse
- Domain
- Infra
- Source
- Github Issue
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.