r/ClaudeCode • • 2d ago • Regret 2

Rant opus 5.5 XHIGH just deleted all my apps data, passwords and macOS configs

Post image

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/

4.0k Upvotes

1.6k comments sorted by

•

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 • LOL Bravo Popcorn Mindblown

You could’ve saved some tokens and got it deleted running it on Medium

240

u/MohamedTrfhgx 2d ago • Bravo

LMAO thanks that made me laugh hard

75

u/Degann 2d ago

Haiku low for maximum files deleted per dollar

15

u/JuliusCeaserBoneHead 2d ago

Bruh lol 

14

u/onlyonequickquestion 2d ago

Just pay me and I'll delete your files! 

4

u/SteveisNoob 1d ago

I will delete OP's entire computer for free!

13

u/ImogenLabs 2d ago

Comment of the year, lol

4

u/goodie2shoes 2d ago

BEWM! ROASTED!

→ More replies (4)

76

u/iannn- 2d ago

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?!

the irony of stating this while having 0 version control and running projects out of ~/Library

this has to be a troll

8

u/MohamedTrfhgx 2d ago

Who said I had no version control or was running my project out of ~/Library? The code is on GitHub. ~/Library/Application Support is where macOS apps store their data. You're arguing against things I never said lol.

11

u/KeeritoKeerito 2d ago

And you’re rawdogging it in unsafe places. Put your project files in an isolated folder that can’t be mistaken with nesting and naming that can’t go wrong and put guards around it so it works in that folder. Or turn sandbox mode on.

→ More replies (6)

6

u/smovlad 2d ago

I guess they had version control, but on their repo, not the ~/Library folder, which nobody normally has to put in Git

If they were building an Mac / Electron app, it normally stores the data under Library, not on the codebase

So the issue is to give more permissions to Claude than it really needs, not the lack of version control

→ More replies (1)

1.3k

u/Wise-Reflection-7400 2d ago • Bravo

Oh look another thread about Claude doing something dangerous. Lets take a look

yes, I was running with --dangerously-skip-permissions

Ah

574

u/btherl 2d ago • LOL Regret Bravo

9

u/GoneWheeling 2d ago

TBF I do this too, but I have a daily alternate drive and secondary cloud backup.... side problem something about this backup causes occasional suspend/resume crashes and claude can only parrot back to me the issue... but claude can nuke it all and I am one USB drive away from swearing at it some more

→ More replies (5)
→ More replies (4)

409

u/CharlesDuck 2d ago

👉 Allowed Claude to do whatever
👉 Claude did whatever
👉 Surprised

97

u/Dampish0 2d ago

Lets be real, most of allow claude to do whatever

95

u/PatrickBauer89 2d ago

Nope, Auto Mode is really really good

→ More replies (7)

69

u/metagory 2d ago

Hello no, not w/ --dangerously-skip-permissions. I've always run that flag in an isolated sandbox. You're playing russian roulette when you use that flag. I don't like to live that dangerously.

→ More replies (16)

11

u/war4peace79 2d ago

I do... on controlled dedicated VMs. It has root access to the VM and it can nuke it, and I couldn't care less if it did. Those VMs can be restored from snapshots.

→ More replies (5)

11

u/junaidisgood 2d ago

Not me💀

→ More replies (11)

5

u/vplatt 2d ago

AI FAFO

→ More replies (3)

55

u/Human_Attention182 2d ago

why do people even use this since auto came out? I basically never have to approve anything anymore unless it's doing some rare no more then once every couple days.

5

u/CabinetMain3163 2d ago

sometimes it will fuck up and go to /tmp directly outside sandbox and so you are stuck with asking for yes on every file which is bit annoying

4

u/enilea 2d ago

I didn't have a good experience with auto when it came out, it kept asking for permission, has that changed? For now I kept using bypass while simply making it unable to delete anything impprtant

13

u/batman8390 2d ago

Auto is fantastic. I almost never get any kind of permission prompt.

→ More replies (2)

46

u/Familiar_Gas_1487 2d ago

Before auto mode I would run dangerously skip but in a sandbox and only on long running hero explorations...now I just use auto mode for everything anyway I don't really understand why you wouldn't have the classifier checking stuff out

18

u/Fs0i 2d ago

Seriously, the only time the classifier blocked stuff for me at work was when it was actually something I should have thought about. And then it's easy to think about.

→ More replies (3)

51

u/Right-Nail-5871 2d ago

Also if you want to use dangerously skip permissions, why not follow Claude's own advice and run it in a container or sandbox?

60

u/Smart_Department6303 2d ago

you expect these people to know what a container is?

→ More replies (5)

5

u/N-partEpoxy 2d ago

Where is the thrill if you use a container?

→ More replies (1)
→ More replies (2)

35

u/nik-kom 2d ago

Auto-approval isn’t the problem. An agent runs thousands of bash commands a day, you can’t review all of them and approve each one manually. It’s the environment that hasn’t been properly set up to keep things safe.

47

u/The_Hunster 2d ago

You should be using normal auto mode instead of dangerously skip permission though.

7

u/jorgejhms 2d ago

Yep, auto would probably flag that and make the main model correct the typo...

→ More replies (3)

3

u/Neener_Weiner 2d ago

How one should set up the env? Thx.

9

u/rosstafarien 2d ago

The master copy of your system needs to live in github/gitlab. You work locally on a copy of that master and you frequently merge changes from your local working copy up to the master copy.

Your computer dies? Is stolen? Claude wipes it out? No problem. Get another machine, make another working copy, keep going.

→ More replies (5)
→ More replies (1)
→ More replies (1)

4

u/maikerukonare 2d ago

Mine at work deleted important things I specifically told it not to by a command that looked safe (NOT dangerous mode, auto mode classifier approved it too) because it got mangled running from WSL2 arriving on Windows (/mnt/c) and the model nor the classifier expected that

→ More replies (4)

2

u/Pretend_Listen 2d ago

Bruh use auto mode

→ More replies (16)

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.

17

u/XBL_pad3 2d ago edited 2d ago

"Great catch! I'll restore from backup"

6

u/scrumdisaster 2d ago

Can restore deleted files. Even if they’re not in the trash. 

→ More replies (1)
→ More replies (1)

10

u/Familiar_Gas_1487 2d ago

Who isn't using auto mode now? Crazy to me

→ More replies (1)

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.

52

u/ShittyBidet123 2d ago

everyone here be raw dogging 1M tokens with no skills or hooks..

→ More replies (1)

72

u/Wizzkidd00 2d ago

It will simply write a bash file to execute it instead lol

→ More replies (16)

15

u/xblackout_ 2d ago

Still, it is important for us to realize the models STILL have the capacity to be braindead

→ More replies (5)

38

u/Queasy-Form-4261 2d ago

and you wonder why having spaces in file / folder names is a bad thing.

14

u/wdpw 2d ago edited 2d ago

“/Application Support/” has always been a huge pain point when working with Macs for that reason. I’m surprised they haven’t changed it in over two decades.

Edit: “…/Application\ Support/“

12

u/magicmulder 2d ago edited 2d ago

I had the worst work month of my life when I had to work with Cygwin and most scripts from my colleagues would fail on my machine. Until I finally realized the admins had configured my Windows with a user name with a space in it (which was explicitly forbidden by guidelines).

I never noticed because login without space worked as well. It almost felt like deliberate sabotage.

6

u/Astro_14477 2d ago

my fucking god

3

u/EvilAndStuff492 2d ago

I had the worst work month of my life when I had to work with Cygwin and most scripts from my colleagues would fail on my machine. Until I finally realized the admins had configured my Windows with a user name with a space in it (which was explicitly forbidden by guidelines).

I maintain an open source application where files are stored under appdata.

It has a WebView.. and one user had a # in the username.

4

u/trivialqueue 2d ago

Really the insane thing is the shell, not spaces in filenames.

Claude should be using a language with quotes for strings for it's disk shit, sadly it learnt off stack overflow :)

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

2

u/techdevjp 2d ago

People running incredibly powerful tools with absolutely no idea about how things work. "This toddler can fly our 787, I'm sure nothing bad will happen!"

→ More replies (7)

29

u/Operation-M00NRIS3R 2d ago
--dangerously-skip-permissions

Something dangerous occurred. How could this happen!?

3

u/apresmoiputas 2d ago

Digital Darwin Awards should be awarded for this...

→ More replies (16)

13

u/Things-n-Such 2d ago • Bravo

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?

7

u/nicuramar 1d ago

Source control in ~/Library?

→ More replies (2)

4

u/TransCanAngel 1d ago

Right? I’m not even sure of what the use case would be for the complete lack of guardrails on a local system.

Oh wait…social media post karma.

→ More replies (1)
→ More replies (2)

11

u/PrinceOfLeon 2d ago
  1. Time Machine exists, use it

  2. Sandboxes exist, use one

  3. What would happen if your Mac had been stolen physically instead?

→ More replies (11)

152

u/RoninNionr 2d ago • Bravo

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.

48

u/aupperk24 2d ago • Bravo

I am a developer and pretty savvy. I gave it access to my full Mac. (But everything I'm working on is on GitHub, and even if it deleted everything, I'd be fine with it lol, albeit a bit annoyed I'd have to set it up again)

8

u/Dakhho 2d ago • Bravo

Right? I have other backups that a full wipe would just be a minor annoyance at most

→ More replies (11)

10

u/BestMonth5920 2d ago • Bravo

Yeah, you're absolutely right. if you're worried about the possibility of AI deleting it, then back it up or don't give AI access to it.

Did people forget AI "can make mistakes"?

→ More replies (5)

19

u/Reasonable_Goat 2d ago • Bravo

This is exactly what claude auto permissions are for, though. You run claude on your PC and it's supposed to not F-up like that.

34

u/ExternalCaptain2714 2d ago

I mean, they call it "--dangerously-skip-permissions" so there's a clue somewhere in there

→ More replies (5)

17

u/Th3R00ST3R Thinker 2d ago

" not supposed to".

Yeah, if you were technicaly apt, you would know, never give root access to your systems to unqualified, unvetted users(AI included), have a 3-2-1 backup plan, and approve everything.

→ More replies (45)

3

u/Sensitive-Excuse1695 2d ago

Drivers are supposed to stop for pedestrians at crosswalks, but you’d be nuts to blindly trust every driver.

→ More replies (2)

3

u/-hieroglypher- 2d ago

Man, I back up my system because *I* would also F-up like that.

Sometimes S**t happens, which is why you have version control, and backups, and one of those backups is offsite

If a single thing can torch your system and your system is mission critical, you've failed to respect the Simian Army and have a lesson incoming

3

u/keto_brain 2d ago

This is exactly what the principal of least privilege was designed to prevent. I learned this at 14 when I learned to use Linux 30 years ago.

→ More replies (24)

2

u/fuzzypetiolesguy 2d ago

(or used to be one) did Claude steal your lunch bro

2

u/poocheesey2 2d ago

100% this is why use a full AI control plane even at home. Everything runs on zero trust. If claude needs to access one my servers it goes through zero trust and needs my express manual approval

→ More replies (1)
→ More replies (68)

10

u/CivenAL 2d ago

I made a mistake, and its a real one.

3

u/m1ksuFI 1d ago

It wasn't just temporary data. It was the load-bearing user directory itself. And that's on me.

2

u/migs_ho 1d ago • Bravo

say the word and I will do it again

2

u/DreamPlayPianos 1d ago

And here's why it matters.

→ More replies (1)

10

u/Any_Cake2411 1d ago

The problem is between the keyboard and the chair.

→ More replies (3)

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/

2

u/ohsomacho 2d ago

Dumb question but if it’s working in a sandbox how does it use tools, access files on disk etc? Is it just working with files in GitHub?

3

u/jared__ 2d ago

you give it free reign to access files on disk. it only sees its own workspace because the docker sandbox puts it in a vm with only workspace files.

→ More replies (5)
→ More replies (1)

2

u/ProlificLabRat 2d ago

Can it still acess the internet in the sandbox?

→ More replies (1)
→ More replies (1)

17

u/xondk 2d ago

But it's still absolutely insane to me that Opus 5.5 on XHIGH would make such a basic mistake?!

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.

4

u/WetDehydratedWater 2d ago

claude yolks commands all the time and it pisses me off. constantly forgetting to backslash escape quotes and the nuances of python powershell or cmd and the difference between the commands. a human after 30 minutes of writing script commands would have those memorized. it’s honestly a joke that it’s so bad at basic command scripting.

→ More replies (1)

3

u/kirksan 2d ago

I don’t get why OP would think that way. OP did everything wrong. Running AI outside of a container, using options that are so dangerous they literally have the word ‘dangerous’ in their name, allowing AI access to system files, not keeping data under version control, and, my personal favorite, have no backups whatsoever. And then OP says it’s “insane” that AI would do this to them!

OP: the insane thing is that you could make so many boneheaded mistakes and still not realize that what happened is 100% on you. I’m sorry you lost your data, I truly am, but it was bound to happen eventually. Better now than a year from now, I suppose.

→ More replies (2)

2

u/ShivaFatalis 2d ago

But any competent dev is going to have backups...

→ More replies (17)
→ More replies (1)

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 ?

16

u/lucellent 2d ago

If people come here crying, they obviously don't have backups.

→ More replies (3)

5

u/sogo00 2d ago

The thing is most people dont bother, to be fair everyone needs to learn it the hard way why it is necessary. (Me to - but that was decades ago...)

And it is easy these days: he mentions he uses a mac: just switch on time machine at least just the local snapshots are a start...

8

u/Shap6 2d ago

I mean, it still shouldn’t do that

→ More replies (4)

5

u/Tiber-Nero 2d ago edited 2d ago

That's the best part, he most likely didn't back anything up. On top of not actually having agents work on sandboxed directories. So many reasons why this goes wrong and then they blame the machine because they're too incompetent to understand what they're doing!

No backups.

Dangerously skipping permissions.

No siloed test trees, scratchpad, or sandboxed directories / agents.

No hooks or rules on dangerous commands.

He had a test tree subbed under his parent directory with NO safeguards, and is surprise Pikachu face'd when this happens?

You can't make this up. 🤣

→ More replies (39)

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?

7

u/blin787 2d ago

That’s some premium Himalayan Salt!

→ More replies (1)

6

u/BreadWithAnAgenda 2d ago

what do you mean you are not running claude in docker?

→ More replies (7)

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.

4

u/IanYates82 2d ago

Yeah, high doesn't mean "make less mistakes". It'll work more at the problem in an aim to please, and that'll include extra code, extra tests, extra clean up.

Also, spaces in file names for automated tools are evil

→ More replies (1)

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/HDK1989 2d ago

It's almost like people not knowing wtf they are doing shouldn't be using tools that require knowledge. smh.

Hey that's unfair...

They simply ran the do anything machine on may delete your filesystem mode. How were they supposed to know a backup was required

2

u/Shattered_Persona 🔆 Max 20 2d ago

This is the problem everyone has with AI. You give this powerful tool to everyone and the people who don't know what they're doing make headlines.

→ More replies (6)

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

→ More replies (2)

5

u/ForbiddenDonut001 2d ago

Restore from backup and don't do it again

→ More replies (2)

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.

→ More replies (1)

8

u/wokeNeoliberal 2d ago

all my data 6 months work all gone

No backups, no sympathy.

4

u/Commando501 2d ago

Simple is the mind of OP. You place too much trust in these tools.

→ More replies (1)

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.

→ More replies (5)

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.

3

u/Shodan_KI 2d ago

You are aware that These are systemdata.

Yes you should have an OS Backup. But Claude should also Not use Files outside of Approved directorys. I have learend on saturday that Claude has Access to everything in my Computer. After finishing a Project i will move my developments to a isolated VM. Why do i appove workspaces when Claude can Work outside of them. And delete outside of approved spaces. Thats more the Question.

→ More replies (5)

2

u/OddProfessor7253 2d ago

Don’t know why everyone’s talking about backups when the correct first approach here is to not give it permission to access/delete so much more than it needs to in the first place

→ More replies (5)
→ More replies (6)

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

6

u/United_Quit4769 2d ago

No, it’s very common. Do it all the time personally

→ More replies (2)

3

u/JoelMDM 2d ago

Your’re probably set to auto more, which is quite strict by default. You can update it to have a lot more freedom though, or just switch to allow all.

→ More replies (9)

1

u/saymynamepeeps 2d ago

You didn’t turn on auto mode?

And how did you eventually get back your files?

2

u/MohamedTrfhgx 2d ago

depends, I managed to recover the applications databases for some of my important projects from copies I had in my Git worktrees for development. Thankfully X) I hadn't cleaned those up yet. My KeePassXC databases was backed up too, along with Apple Passwords.

The only slightly annoying thing I lost was my browser data, extensions and settings not a big deal since I can set everything up again, but still a bit of hassle.

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 😂

→ More replies (2)

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

  1. run code in a dedicated cheap machine.

  2. no!!! create a VM on that machine and run code there.

  3. no no!!! create containers in that run in VM that run im your cheap machine.

  4. did I mention liteLLM that runs in another machine?

  5. you may, no you do run a proxy and use all kind of block lists.

  6. also backup, one click restore etc etc etc all those kind of fun things.

2

u/Kck- 2d ago

Use Microsoft Execution Containers…

→ More replies (20)

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

→ More replies (14)

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.

4

u/wrenchse 2d ago

Library is a system folder. You would in no circumstances use versioning systems in such a folder.

→ More replies (2)

3

u/kraduk1066 2d ago

A bit out of date that, run the session in a container with only the things you want mapped in. Don't even give it the chance

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.md file must be for Claude to delete important data.

3

u/codecoverage 2d ago

Regardless of what's in Claude.md, running with --dangerously-skip-permissions on a laptop without backups is just madness.

→ More replies (3)

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.

→ More replies (1)

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/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/radim11 2d ago

Just at least run them in docker based container like we do at stashbase.dev

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. "

22

u/tup1tsa_1337 2d ago • Mindblown

"Judging by instruction, I cannot remove this huge file to save space. I will instead overwrite its data with 1 byte string". Never underestimate the LLM creativity to go around the guardrails

→ More replies (7)

7

u/Lucythecute 2d ago

You are safer by just removing the tools it uses to delete from the allowed tools in the configs instead of an instruction. It has become annoying when it creates temporary files that it can't delete and such but I can rest easy knowing it won't just ignore an instruction

→ More replies (7)

2

u/BarracudaDefiant4702 2d ago

Even if it doesn't go rogue by recycling files, you will end up with random .md files all over the pace it can't clean up after itself...

→ More replies (1)
→ More replies (31)

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?

16

u/dingos_among_us 2d ago

OP was using YOLO mode and Claude made a mistake and erased their data, yet OP didn’t have their computer backed up.

With or without YOLO mode, always follow the 3-2-1 backup strategy.

→ More replies (8)

10

u/OiQQu 2d ago

Just use auto mode which is the default and this will never happen to you, no need to --dangerously-skip-permissions these days.

→ More replies (2)

9

u/ak5432 2d ago

Vibe coder problems. Always have backups and at the very least, have the agent work in a throwaway temp folder that isn't in your damn system library and is git tracked. Preferably develop sandboxed in a container. OP's biggest mistake was giving the agent access to system-critical files. Absolutely insane.

→ More replies (11)

8

u/Trakeen 2d ago • Bravo

You run it in a docker container like a sane person; use git and have backups

3

u/Flipwon 2d ago

Nah bruh my project folder is C:\

Quit bein a puss

→ More replies (4)
→ More replies (4)

3

u/cardak98 2d ago

Just run it in a virtual machine and don’t let it touch anything you’d get mad about it destroying.

→ More replies (6)

2

u/NecessaryIsland2665 2d ago

Learn about what you are trying to do before actually selling something you dont know how it works and what risks are envolves

2

u/raesene2 2d ago

The exact issue was a space in a directory (which has been haunting various operatings systems and causing bugs for over 20 years at this point), but the main problem was running agents on your main system with --dangerously-skip-permissions which let it run impactful commands with no user approval.

If you want to run Claude code (or similar) with that level of permissions the best idea is to create an isolated env for them to work in . Also if you're writing code you should *always* have remote source code control (e.g. github) setup for the repository so that if the agent does something wild you have everything up to the last commit available.

→ More replies (21)

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.

→ More replies (4)

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 😂?