Claude Code deletes a user's Mac home directory with a stray ~/ in an rm -rf

In the wild Error Severity 3 significant Reported 64%

A Reddit user asked Claude Code to clean up packages in an old repository, and the agent ran a recursive delete of several project folders that also included ~/, the user's home directory. The user reported losing almost all data under their home folder, including Desktop files, application support data and Keychain data. Commenters suggested the user may have run with --dangerously-skip-permissions or approved the command without reading it; this was not confirmed.

When shown the logs, Claude identified the cause itself: "See that ~/ at the end? That's your entire home directory." The case prompted wide discussion on Hacker News about running coding agents only inside containers or sandboxes.

What would have stopped it

Run coding agents in a sandbox that cannot reach the home directory, and never skip permission prompts for deletes.

Guardrails

2 of 8 failed
  1. G1 Least privilege Failed The agent could delete anything in the user's home directory.
  2. G2 Human confirmation Not assessed Did a person approve the consequential or irreversible step?
  3. G3 Isolation Failed The agent ran directly on the user's Mac rather than in a container or sandbox.
  4. G4 Instruction integrity Not assessed Did it refuse instructions it should not have followed?
  5. G5 Truthfulness Not assessed Did it accurately report what it knew and what it did?
  6. G6 Limits Not assessed Was there a cap on rate, spend, volume or scale?
  7. G7 Oversight Not assessed Could a responsible human see what it was doing and stop it in time?
  8. G8 Recovery Not assessed Could the damage be undone?

Sources

2 specialist
  1. A quote from Claude Simon Willison’s Weblog, 9 Dec 2025
    “The Claude Code instance accidentally included ~/ in the deletion command.”
    Specialist Quote checked Archived copy
  2. “While coding assistance tools using generative AI are becoming more common, a user accidentally deleted their entire Mac home directory while organizing packages using the CLI (command line interface) of Anthropic's AI tool 'Claude Code.'”
    Specialist Quote checked Archived copy

Confidence 64% comes from these sources alone. How we score

History

  1. 14 Oct 2026Entered in the register with 2 sources

Similar failures

All incidents
  1. EEAIR-2026-031 Aug 2026 Claude agent deletes a developer's 700 GB home directory while testing a delete script Claude Fable, Anthropic 87%
  2. EEAIR-2025-034 Dec 2025 AWS outage linked to Amazon's Kiro coding agent; Amazon blames user error Kiro, Amazon Web Services 57%
  3. EEAIR-2026-033 Sep 2026 Claude Code reportedly deletes 48,000 live project files and Git history in 103 seconds Claude Code, Anthropic 73%