- cross-posted to:
- Technology@programming.dev
- cross-posted to:
- Technology@programming.dev
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:
- Your desktop is gone
- Your keychain was deleted
- Your Claude credentials disappeared
- The error at the end says “current working directory was deleted”
I imagine the reason it’s included is due to the training data containing so many
sudo rm -rf ~/jokes from RedditLearn to use devcontainers or suffer.
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.
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.
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.
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.
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”
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.



