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”
  • niemcycle@lemmy.ca
    link
    fedilink
    arrow-up
    10
    ·
    10 hours ago

    I imagine the reason it’s included is due to the training data containing so many sudo rm -rf ~/ jokes from Reddit

    • trolololol@lemmy.world
      link
      fedilink
      arrow-up
      1
      ·
      7 hours ago

      I am paranoid enough to have started looking into some kind of os level protection but couldn’t make significant progress. Is there anything out there easy to use where I can only give write access to the project folder? I’m in Linux but I’m also curious about Mac solution. I couldn’t care less about windows, I won’t touch that thing.

  • Rekall Incorporated@piefed.social
    link
    fedilink
    English
    arrow-up
    1
    arrow-down
    6
    ·
    15 hours ago

    In all fairness, it is likely such cases will be resolved by the service providers.

    Not to be overly arrogant, but I think this particular user would have been caught in similar situations unrelated to Claud CLI.

    • wholookshere@piefed.blahaj.zone
      link
      fedilink
      English
      arrow-up
      2
      ·
      14 hours ago

      I mean yes and no?

      the delete system 32 meme is an old meme.

      but how often are people really told to do something like that on the internet? If your in a forum, people don’t recommend steps like that, and certainly not without it being called out as such.

      so it’s possible to come across that on the internet, but way more rare than the two cases I’ve seen on the last couple of months from AI.

      • Rekall Incorporated@piefed.social
        link
        fedilink
        English
        arrow-up
        1
        ·
        13 hours ago

        I meant that Claud, Gemini, OpenAI will probably add additional hardcode limits for deleting your home directory.

        The individual in the reddit post let an LLM run deletion commands on their system (in my understanding with explicit approval) and they work in tech.

        • XLE@piefed.social
          link
          fedilink
          English
          arrow-up
          1
          ·
          11 hours ago

          Companies like OpenAI won’t even hardcode a shutdown command for conversations that go into suicide methods… They just talk about “guardrails” all day, which is apparently the AI equivalent of “thoughts and prayers”

        • wholookshere@piefed.blahaj.zone
          link
          fedilink
          English
          arrow-up
          1
          ·
          13 hours ago

          I mean they can try?

          the problem is computers tend to use unique paths to home. so I don’t know that you can fully solve it, without making something that’s actually knows what it’s doing. which LLMs are predictive text, not understanding.