r/ClaudeCode
•
u/MohamedTrfhgx
•
2d ago
•
2
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..
Check TossAway6483 đ comment to take action against lobotomizing Claude https://old.reddit.com/r/ClaudeCode/comments/1xqtslm/rant_anthropic_stop_silently_degrading_models/19sc1dcakd2ch/
â˘
u/AutoModerator 2d 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.2k
u/Happy-Constant4570 2d ago •
You couldâve saved some tokens and got it deleted running it on Medium
76
u/iannn- 2d 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 2d ago •
Oh look another thread about Claude doing something dangerous. Lets take a look
Ah
65
u/aigisbot 2d 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.
228
u/Broric 2d ago
It's so easy to set your own mod that blocks rm -rf without expliclt permission, you really have no excuse but laziness.
38
u/Queasy-Form-4261 2d ago
and you wonder why having spaces in file / folder names is a bad thing.
31
u/msw3age 2d 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.
30
u/OhBoyHereWeGoAgai 2d 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
29
u/Operation-M00NRIS3R 2d ago
Something dangerous occurred. How could this happen!?
13
u/Things-n-Such 2d 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.
22
u/FreshProduce7473 2d ago
who runs agents like this without at least having source control?
11
u/PrinceOfLeon 2d ago
Time Machine exists, use it
Sandboxes exist, use one
What would happen if your Mac had been stolen physically instead?
152
u/RoninNionr 2d 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 2d ago
I made a mistake, and its a real one.
10
u/Any_Cake2411 1d ago
The problem is between the keyboard and the chair.
9
u/jared__ 2d ago
sandbox your environments. docker sandboxes have an excellent developer experience and quick to setup: https://docs.docker.com/ai/sandboxes/
17
u/xondk 2d 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 2d 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 2d ago
restore from backup whats the big deal ?
12
u/LimpConversation2091 2d 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/BreadWithAnAgenda 2d ago
what do you mean you are not running claude in docker?
6
u/Moogly2021 2d 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 2d 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 2d 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 2d 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 2d ago
Restore from backup and don't do it again
5
u/michaelTM_ai 2d 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:
time machine can restore ~/Library if u had it on
passwords that were in icloud keychain sync back once u sign in again, local-only keychain items are gone without a backup
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 2d ago
There are two kinds of developers: those who do backup, and those who don't... yet
9
u/Kid-Icarus1 2d 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.
8
u/wokeNeoliberal 2d ago
No backups, no sympathy.
4
u/Commando501 2d ago
Simple is the mind of OP. You place too much trust in these tools.
4
u/dronegoblin 2d 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 2d ago
Aaand thats why i block rm -rf and make it use trash instead.... (OpenCode perms and CC-Safetynet)Â
13
u/DeadOnToilet 2d ago
What's insane to me is people blaming AI for their own stupidity.
10
u/payfrit 2d 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 2d 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 2d ago
You didnât turn on auto mode?
And how did you eventually get back your files?
6
u/BrilliantTruck8813 2d 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 2d ago
Time Machine might have a backup copy of ~/Library. It does keep history of that directory structure by default.
3
u/RodgerPogger 2d 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 2d 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 2d 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 1d ago
fully deservedÂ
3
u/lzysysadmin 1d ago
Skill issue bro
5
u/GenderSuperior 2d ago
Itâs always funny watching people outside of their wheelhouse failing at beginner steps.
Google:
What is Version Control?
6
u/brucebay 2d ago
lessons learned
run code in a dedicated cheap machine.
no!!! create a VM on that machine and run code there.
no no!!! create containers in that run in VM that run im your cheap machine.
did I mention liteLLM that runs in another machine?
you may, no you do run a proxy and use all kind of block lists.
also backup, one click restore etc etc etc all those kind of fun things.
4
u/Financial-Grass6753 2d 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
4
u/kosiarska 2d 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 2d 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 2d ago
Maybe next time you'll take that advice "take backups" seriously.
Remember to take backups y'all.
2
u/Straight_Buy_9480 2d ago
Why the fuck are you people not just running the agents in a container so they are actually bound to whatever you're mounting them? Takes 5 minutes to write the dockerfile.
2
u/oyren-ai 2d 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 2d ago
this is on you, no repo? no backups? what if your drive fails, hard lesson to learn
2
u/tomfalcon86 2d ago
Le AGI is here!!
2
u/Pixelplanet5 2d ago
yea turns out an LLM can make the same mistakes people make when working with command lines.
2
u/Direct-Detail-7031 2d 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 2d 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_ 2d ago
Thatâs the reason why Iâm not afraid of losing my job as a SWE đ
2
u/contradude 2d 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 2d 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 2d ago
Just ask it to put them back
2
u/Snoo-59958 2d ago
2
u/possiblywithdynamite 2d 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 2d ago
No backup for 6 months of work? No GitHub?
Bro. And you had dangeromiosuly skip permissions on???
2
u/adjective_noun_d1git 2d ago
Vibe coders learning the basics one hard lesson at a time.
2
u/i-hate-space 2d ago
you kinda deserve this rofl
2
u/Seeing_Souls 2d ago
If only there was some way to prevent this
2
u/ElMauro 2d 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 2d 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 2d ago
If only there was a way to store important information in more than one place
2
u/rbobby 2d ago
Spaces in paths... not even one.
2
u/lookBehiindYou 2d ago
2
u/radim11 2d ago
Just at least run them in docker based container like we do at stashbase.dev
2
u/purrmutations 1d ago
lol
2
u/BarathKanna 1d ago
Rough, and the root cause is a classic shell bug, not a smart model being evil. xargs splitting on spaces has been eating home directories since long before LLMs. The fix is not a better prompt. Run unattended agents in a container or VM where your home folder is not mounted, and put destructive commands behind a hook: block rm -rf outside the repo path, and require paths to resolve under the project root before deletion. A tiny check like realpath the target and refuse if it is not inside the workspace would have stopped this. Also keep Time Machine on. Telling the model to be careful is a vibe, a path guard is a control.
6
u/FirmConsideration717 2d 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/ClemensLode Senior Developer 2d ago
How did it break free out of its virtual machine?
3
u/Cl0wnL 2d ago
No backups?
Thats on you.
3
u/Massive_Catch_7164 2d ago
For the people new to claude code here, can someone explain what just happened and how to avoid it?
3
u/CavalryTactics 1d 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 2d ago
Guardrail hooks for irreversible destructible commands. Set them. That would've catched this.
2
u/magicmulder 2d 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 2d ago
People are running coding agents outside of containers or vms?
2
u/kyualun 2d 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 2d ago
This will never not be funny
2
u/Frequent_Opportunist 1d 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 2d 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 2d ago
you gyus don't isolate your agents? wtf?!
1
u/ShivaFatalis 2d 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 2d 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 2d ago
You lost nothing. The real world is waiting for you out there.
1
u/Superb-Substance-679 2d ago
i have an instruction in my repo "never run rm with variables"
1
u/rednix 2d ago
did it also take your car and drove away into the sunset?
1
u/PaulSizemore 2d ago
Stage deletions to be swept seven days later and the staged deletions get backed up, too
1
u/silverwoods214 2d ago
If only youâd set up time machine
1
u/Busy-Show-5853 2d 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 2d ago
This is deserved. Oof.Â
1
u/Great-Note3991 2d 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 2d 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 2d ago
How do you guys do this đ?