Source: Reddit Post.

Claude CLI deleted my entire home directory! Wiped my whole mac.

I was having the Claude CLI clean up my packages in an old repo, and it nuked my whole Mac! What the hell? Has anyone ever had this happen? I’m trying to figure out if this is even reversible. So much work lost…

CLAUDE response - I found the problem and it’s really bad. Looking at your log, here’s the catastrophic command that was run:

bash

rm -rf tests/ patches/ plan/ ~/

See that ~/ at the end? That’s your entire home directory. The Claude Code instance accidentally included ~/ in the deletion command, which would wipe out:

  • Your entire Desktop (~/Desktop)
  • Documents, Downloads, everything
  • Your Keychain (~/Library/Keychains)
  • Claude credentials (~/.claude)
  • Application support data
  • Basically everything in /Users/…

This explains why:

  1. Your desktop is gone
  2. Your keychain was deleted
  3. Your Claude credentials disappeared
  4. The error at the end says “current working directory was deleted”
  • ulterno
    link
    fedilink
    English
    arrow-up
    0
    ·
    3 天前

    Might not be “willing”, but just going, “oh it’s fine. What’s the worst that could happen”.
    Also, I failed to understand how Claude code generated another response after deleting the Claude credentials. Does it save the token in RAM?

    • TrickDacy@lemmy.world
      link
      fedilink
      English
      arrow-up
      2
      ·
      3 天前

      Ok I was addressing the laziness option. Seems you’re now you’re just explaining the moronic “logic”.

      • ulterno
        link
        fedilink
        English
        arrow-up
        0
        ·
        3 天前

        I’d say:

        • Being lazy would mean, saying “What’s the worst that could happen?” and then not answering it.
        • Being moronic would mean answering it wrong.