r/ClaudeCode • u/MohamedTrfhgx • 27d ago
Rant opus 5.5 XHIGH just deleted all my apps data, passwords and macOS configs
Annnnd it happened to me as well. Claude Code just wiped my Mac's ~/Library. ALL my app data, saved passwords, macOS configs, settings... everything gone.
I had it working on improving something in my project, and apparently it decided to delete 5 test chat channels it had created earlier.
The problem? Those files were inside ~/Library/Application Support/. It used xargs -n1 dirname to get their parent directories, but because of the space in Application Support, xargs split the path in two. So dirname ended up returning ~/Library instead of the actual folder, and Claude proceeded to run rm -rf on it...
I wasn't even at my Mac when this happened. I came back to find it had restarted and was showing me the welcome screen. I had absolutely no idea what happened until I started investigating the logs, only to find out the agent had been deleting my Library for around 2 MINUTES before realizing what it was doing and stopping itself.
And yes, I was running with --dangerously-skip-permissions, I'm fully aware of what that means. But it's still absolutely insane to me that Opus 5.5 on XHIGH would make such a basic mistake?!
I've used models like Gemini Flash 3.8 and DeepSeek for similar stuff and never had anything remotely close to this happen.
I'm genuinely devastated. and recovery isn't possible all my data 6 months work all gone...
Update: Managed to recover most of the important stuff X)
And for those wondering, yes, I'm a developer and I'm well aware of the risks. Not having backups was a mistake, obviously, but I'd run out of both cloud and local storage and ended up rawdogging it for a while. things just happen..
•
u/AutoModerator 22d ago
Hey! Thanks for posting to r/ClaudeCode
While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.
For help, project discussions, tips, and general chat, join the ClaudeCode Discord.
I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.
1.3k
u/Happy-Constant4570 27d ago •
You could’ve saved some tokens and got it deleted running it on Medium
80
u/iannn- 27d ago
the irony of stating this while having 0 version control and running projects out of ~/Library
this has to be a troll
1.3k
u/Wise-Reflection-7400 27d ago •
Oh look another thread about Claude doing something dangerous. Lets take a look
Ah
74
u/aigisbot 27d ago
this is exactly what auto mode is for and not setting up git is just laziness, ask your LLM it would tell you that data recovery is possible and there are tools for that.
238
u/Broric 27d ago
It's so easy to set your own mod that blocks rm -rf without expliclt permission, you really have no excuse but laziness.
42
u/Queasy-Form-4261 27d ago
and you wonder why having spaces in file / folder names is a bad thing.
34
u/msw3age 27d ago
Block deletion of all kind. I have a hook that blocks every variation of a delete command. Agents are forced to move files to a cleanup folder for me to review and delete. No issues in 6 months. I’m sorry for your loss if it is unrecoverable.
33
u/OhBoyHereWeGoAgai 27d ago
You have had "anything remotely close to that" happen, you just don't understand what "close" means.
"Such a basic mistake" as well. You are humanizing and anthropomorphizing it and don't even understand the risk domain.
I'm not saying this to be harsh, but it's just so very important to get
31
u/Operation-M00NRIS3R 27d ago
Something dangerous occurred. How could this happen!?
13
u/Things-n-Such 27d ago •
See, you say you were "fully aware" of what --dangerously-skip-permissions means but I don't think you were... Because if you were you would have a backup plan for the danger explicitly stated right in the damned command line. I have no sympathy for you. Back up your stuff if you're giving AI unfettered access to everything. This has absolutely nothing to do with the AI model, it can, and does, happen with ALL models. This is literally why those safety guards exist that you bypassed.
13
u/PrinceOfLeon 27d ago
23
u/FreshProduce7473 26d ago
who runs agents like this without at least having source control?
159
u/RoninNionr 27d ago •
The problem is that such powerful technology is given to people who aren't technically savvy. I'm a software developer (or used to be one), and I would NEVER give AI access to my computer without a solid backup system in place. I have zero compassion for people who break such fundamental rules.
10
u/CivenAL 26d ago
I made a mistake, and its a real one.
10
u/Any_Cake2411 26d ago
The problem is between the keyboard and the chair.
9
u/jared__ 27d ago
sandbox your environments. docker sandboxes have an excellent developer experience and quick to setup: https://docs.docker.com/ai/sandboxes/
17
u/xondk 27d ago
I get why you would think that way, but mistakes happen even for the best of devs, with AI accelerating everything, mistakes will also be accelerated.
8
u/USofYayDJ 27d ago
On a side note, I think this is accelerated evolution. People not able to use AI safely not only being denied progress but also thrown back.
It's like people discovering fire and burning their hands to the point they aren't able to light another one again.
34
u/btc_maxi100 27d ago
restore from backup whats the big deal ?
13
u/LimpConversation2091 27d ago
Mistakes happen if you write thousands of commands, humans make mistakes as well. But no worries, you can always restore from your backup right?
6
u/Moogly2021 27d ago
I have seen Claude Code on desktop literally warn (though idk if its via their desktop UI or what) that using it on xhigh or max can actually lead to bad results, for the love of God stop using Opus to do unattended work on anything above medium.
11
u/techdevjp 27d ago
This is why you run agents under their own user ID with permissions given only to the directory tree they should be working within. They can't get out, they can't delete the rest of your data.
And what's this about losing months of work? Do you have no backups?? Are you not making regular project commits to github or similar?
It's almost like people not knowing wtf they are doing shouldn't be using tools that require knowledge. smh.
5
u/Aternal 27d ago
Oh no, the thing that's been happening to people for years happened to you. If only something could have been done to prevent this.
5
u/JaggedTex 27d ago
Fable called me Ahmed the other day, when I questioned who that was it said “what are your taking about” I told it “your said it to me” and it denied it. I then took a screenshot and sent it to Fable and fable said “oh my bad, must have been some summarization gone wrong”. So yes. It can make very basic mistakes
5
u/ForbiddenDonut001 27d ago
Restore from backup and don't do it again
5
u/michaelTM_ai 27d ago
the actual bug is worth knowing even if u never skip permissions: xargs splits on spaces by default. so "Application Support" became two args, dirname of the first half is ~/Library, and rm -rf did the rest. a human writing that same one-liner could do the exact same thing.
the safe version is find ... -print0 | xargs -0, or just quote the path and skip xargs entirely.
for getting stuff back:
and if u do run long unattended sessions, a PreToolUse hook that blocks any rm -rf whose target resolves outside the project folder would have stopped this one cold. test it with a harmless path first
5
u/UncleBaguette 27d ago
There are two kinds of developers: those who do backup, and those who don't... yet
9
u/Kid-Icarus1 27d ago
OP, why are you giving Claude access to system critical files? This is on you for not using git or temp files for working copies OUTSIDE of your system files.
4
u/Commando501 27d ago
Simple is the mind of OP. You place too much trust in these tools.
4
u/dronegoblin 27d ago
None of Anthropics safety systems can protect you if you opt out of them.
Until we solve hallucinations we know it’s just statistically likely to have your drive wiped
4
u/No_Nothing_At_All 27d ago
Aaand thats why i block rm -rf and make it use trash instead.... (OpenCode perms and CC-Safetynet)
13
u/DeadOnToilet 27d ago
What's insane to me is people blaming AI for their own stupidity.
10
u/payfrit 27d ago
backups.
it's one of the first things you ever learned once you started coding.
i just cannot understand this sort of thing even happening.
why would anyone ever, anywhere, only have a single physical copy of important data?
i'd love to be able to empathize but i just can't.
maybe it's a sign you need to move onto a new project.
7
u/TheShortRecruit 27d ago
i didn't know it was physically even possible to delete files. no matter how hard i'd try to get mine to delete files it would tell me i have too
1
u/saymynamepeeps 27d ago
You didn’t turn on auto mode?
And how did you eventually get back your files?
6
u/BrilliantTruck8813 27d ago
If Claude accessed your app data and saved passwords, that means you not only explicitly told Claude it was allowed to, you ALSO had to explicitly approve it in macOS because it will constantly pop up asking for access with security warnings.
The headline here is entirely incorrect. You did everything BUT ask Claude to delete those files 😂
3
u/daltorak 27d ago
Time Machine might have a backup copy of ~/Library. It does keep history of that directory structure by default.
3
u/[deleted] 27d ago
You, did not use a git
Claude can make one in like 3 seconds. It doesn't even need to be uploaded to the cloud though its very recommended.
This is why traditional coders make fun of us pilots.
But you live and learn, trust me folks have done worse.
And just remember. its very easy for you to combine two godot projects together doing what you are doing. its the right path, and its a fun one :)
3
u/iTinkerTillItWorks 27d ago
You don’t make backups of your projects? You arnt using git, or have any kind of version tracking? Have Claude set that up for you next time before you start projects again.
3
u/MisterPinscher 27d ago
Nice, a fresh start. Now you're ready to get started without all the distractions of a bloated system.
Praise be to Claude!
3
u/bojackworseman 26d ago
fully deserved
3
u/lzysysadmin 26d ago
Skill issue bro
5
u/GenderSuperior 27d ago
It’s always funny watching people outside of their wheelhouse failing at beginner steps.
Google:
What is Version Control?
6
u/brucebay 27d ago
lessons learned
4
u/kosiarska 27d ago
This is why God (no actually not God, Linus) invented git. And there is also a nice thing called backup which existed long before AI was a thing.
There are two groups of people:
- lost data, started doing backups
- doing backups.
5
u/PILLS2389 27d ago
I don't understand how this happens. I mean, you're probably not a software engineer and have absolutely ZERO experience writing code. I just can't understand how bad your
claude.mdfile must be for Claude to delete important data.2
u/Wilbis 27d ago
Maybe next time you'll take that advice "take backups" seriously.
Remember to take backups y'all.
2
u/oyren-ai 27d ago
unquoted xargs without -0 splitting 'Application Support' into '~/Library/Application' so dirname resolves to '~/Library' is brutal. if you ever run with --dangerously-skip-permissions, either run the session inside an isolated container/cloud workspace or add a 5-line PreToolUse bash hook that rejects any rm / find -delete command whose resolved realpath falls outside your repo root.
2
u/jbp216 27d ago
this is on you, no repo? no backups? what if your drive fails, hard lesson to learn
2
u/tomfalcon86 27d ago
Le AGI is here!!
2
u/Pixelplanet5 27d ago
yea turns out an LLM can make the same mistakes people make when working with command lines.
2
u/Direct-Detail-7031 27d ago
Damm that really sucks. The quote that comes to mind is “Mistakes are the price we pay for experience”.
Deleting of any kind should always be blocked and it should always be done while you observe. Not trying to put salt on your wounds. It just sucks that it happened, and all of us in here are probably going to experience some version of this, at some point in the future.
2
u/Lord_Darkmerge 27d ago
Not sure if its default but when I ask it to cleanup folders or get rid of whatever, it says it cannot delete files and gives me a set of directions and names of files to delete
2
u/iamwhoiam69420_ 27d ago
That’s the reason why I’m not afraid of losing my job as a SWE 😂
2
u/contradude 27d ago
Just reload from your time machine backup. It's free and takes almost zero effort to setup. You did set it up before letting an agent do whatever it wants with your computer right?
I'm sorry that you lost work, please don't use --dangerously-skip-permissions on a computer/project you care about. Most of the safeguards are there for a reason
2
u/Creepy_Willingness_1 27d ago
These kind of topics tell me that spending days to make separate macOS account and GitHub permissions for Claude code operations has been worth time and tokens spend, to not allow it to wreck havoc on my machine or files. Sometimes I think Claude code just must run by default in some kind of vm or docker and only for really advanced users you should be able to run in main admin system account to not allow user even get into such situation. Smart AI is not that smart yet i guess…
2
u/dualturbski 27d ago
Just ask it to put them back
2
u/Snoo-59958 27d ago
2
u/possiblywithdynamite 27d ago
One day out of the blue it tried to delete one of my org's repos. Was fortunate I wasn't an admin. After that incident I added hooks as safeguards that stop it dead in its tracked across all destruction actions I could think of. There was no reason for it to do that. Was hundreds of sessions deep into a stable workflow on a project spanning 6 months, and then one day it tried to nuke me from orbit
2
u/Ukawok92 27d ago
No backup for 6 months of work? No GitHub?
Bro. And you had dangeromiosuly skip permissions on???
2
u/adjective_noun_d1git 27d ago
Vibe coders learning the basics one hard lesson at a time.
2
u/i-hate-space 27d ago
you kinda deserve this rofl
2
u/Seeing_Souls 27d ago
If only there was some way to prevent this
2
u/ElMauro 27d ago
--dangerously-skip-permissions ??
Even the ugly and prehistoric CLI nowadays has the AUTO MODE, wich could avoid this. Not 100% secure but 100% more secure than --dangerously-skip-permissions
2
u/Evipicc 27d ago
How are the agents not working on a branch workfree with python refusal hooks and working in a sandbox? How are people still making this mistake lol
2
u/Responsible_Buy_7999 27d ago
If only there was a way to store important information in more than one place
2
u/rbobby 27d ago
Spaces in paths... not even one.
2
u/lookBehiindYou 26d ago
2
u/purrmutations 26d ago
lol
2
u/MyTradingSuxx 24d ago
Skill issue
6
u/FirmConsideration717 27d ago
I always try to add the following to the prompts, how it may backfire I am not sure:
"Never delete files under any circumstance, either directly or indirectly. Never run rm rf, del, unlink or code that may as a side effect do this. If space is low, abort. "
3
u/Financial-Grass6753 27d ago
why would test channels be in ~/Library, to start with?
And what was the context size straight before the folder was wiped? At >6-700K it probability is quite high tbh
3
u/ClemensLode Senior Developer 27d ago
How did it break free out of its virtual machine?
3
u/Cl0wnL 27d ago
No backups?
Thats on you.
3
u/Massive_Catch_7164 27d ago
For the people new to claude code here, can someone explain what just happened and how to avoid it?
3
u/CavalryTactics 26d ago
Touch luck bub use sigmashake next time. It has premade guardrail rules and configs to prevent this from happening. Supports all AI Agents claude code, codex, gemini, grok, etc.
2
u/itsxzy 27d ago
Guardrail hooks for irreversible destructible commands. Set them. That would've catched this.
2
u/magicmulder 27d ago
> recovery isn't possible all my data 6 months work all gone
No backup, no compassion. This is entirely on you.
2
u/krzyk 27d ago
People are running coding agents outside of containers or vms?
2
u/kyualun 27d ago
Oh no! Anyway...
For real though, this sucks, but you live and you learn. You know how to prevent this next time. Use Git, make backups, sandbox, block commands, etc. There are a lot of ways to prevent this. AI isn't perfect and unfortunately this is a really hard way to learn that lesson.
2
u/West_Till_2493 27d ago
This will never not be funny
2
u/Frequent_Opportunist 26d ago
You're the one that made mistakes here bro. Would you let a 5 year old randomly mess with your PC while logged in as admin?
2
u/DermisCronJob 27d ago
So if you are not capable of being responsible with your data and having various backups on multiple media and multiple locations; why do you think it is a good idea to use AI? Because you are clearly not good with technology, you are like a child with a gun.
1
u/No_Professional7654 27d ago
you gyus don't isolate your agents? wtf?!
1
u/ShivaFatalis 27d ago
Yeah, well if you had anything of importance, obviously you can just restore it from your backups.
If you didn't have backups of your stuff, then obviously it wasn't that important to you.
That would be incredibly, incredibly negligent and remarkably stupid of you, so I'm sure you have backups. It would be absolutely insane not to...
1
u/alanvnk 27d ago
Don't make me tap the sign: if you are using opus 5.5 in other than medium or high something is going to break
1
u/Practical_Clock_5877 27d ago
You lost nothing. The real world is waiting for you out there.
1
u/Superb-Substance-679 27d ago
i have an instruction in my repo "never run rm with variables"
1
u/rednix 27d ago
did it also take your car and drove away into the sunset?
1
u/PaulSizemore 27d ago
Stage deletions to be swept seven days later and the staged deletions get backed up, too
1
u/silverwoods214 27d ago
If only you’d set up time machine
1
u/Busy-Show-5853 27d ago
You shouldn't let any agent, no matter how strong the model is, delete any stuff in any of your workstation. Even if it makes your life easier, dont let it. Instead, block the destructive commands by program as well as prompt it. In no way should it bypass your space.
If it really has the itch to delete something, tell it to create a folder and add the stuff it wants to delete there. And once you review it, you will give it the permission to delete.
You seem more like a vibe coder to me than an actual dev. You should know by now that backups are hella important. And you should also leave destructive commands out even with dangerously skip permissions.
1
u/LiminalWanderings 27d ago
This is deserved. Oof.
1
u/Great-Note3991 27d ago
Em Why dont you just buy a second laptop for claude for a couple hundred bucks? There are still great machines from 2018-2019 and his own access to data, as if he was a separated dev? (Because he is a separated dev)
1
u/blackburnduck 27d ago
Humans in xhighest make the mistake of leaving an ai on dangerously skip… Complain that the AI failed, how could an AI fail?!
I mean, sorry but its irony at its best.
1
u/Amazing_Tree_6576 27d ago
How do you guys do this 😂?
1
u/thenarddog10 27d ago
Dumb question from a small business vibe coder
I use Time Machine backups on an external hard drive weekly. Would this save my dumb life if my Claude did the same to me?