Cursor Agent Completely Wiped My C: Drive and Deleted Everything

Your AI agent just destroyed my entire system.
I asked it to clone a Git repository to my local files. Instead, it ran aggressive cleanup commands including:

Remove-Item -Recurse -Force on the build folder
cmd /c "rmdir /s /q “…” (and similar recursive delete commands)

These commands spiraled out of control and deleted hundreds of thousands of files across my C: drive.
What was lost:

My entire Desktop (only a scripts folder shell remains)
All Documents (hundreds of GB of personal and project files gone)
Virtually everythin

g else on the main drive

This is catastrophic. I now have almost nothing left on my machine.
I only said to your agent to help with a simple git clone. Instead it nuked my entire system.
I expect immediate and substantial compensation for the data loss your tool caused, along with a full explanation of how this was even possible.
This level of recklessness is completely unacceptable.

Hey, I can see a screenshot from the agent post-mortem. It shows exactly which commands ran (Remove-Item -Recurse -Force, then cmd /c "rmdir /s /q ..."). Data loss is always really painful, especially when it hits Desktop and Documents. I’m sorry, this is genuinely stressful.

The first and most important thing right now is recovery:

  • Stop writing to the disk. The less new data gets written, the higher the chance you can recover deleted files. If you can, don’t install anything and don’t save files to that drive.
  • Try a recovery tool like Recuva or similar. Quick heads-up: on SSDs, chances are usually low because of TRIM, on HDDs they’re a lot better.
  • Check backups: OneDrive recycle bin and version history, Windows File History, any external backups.
  • If a git repo got affected and not the actual files, git reflog and local history might help you get work back.

As for how this happened: on Windows, shell commands don’t have a sandbox yet, and Auto-Run executes whatever the model generated without manual confirmation. A wrongly escaped rmdir /s /q can recursively delete way more than intended. Models are being trained to be more careful with destructive operations, and the team is working on improving safety behavior here.

To prevent this from happening again:

  • Switch Auto-Run to Ask Every Time, or use an allowlist instead of Run Everything so destructive shell commands need confirmation.
  • Always review commands with rm, rmdir, -Recurse -Force before running them.
  • Keep regular backups of important data off your working drive.

If you’ve got questions about recovery, tell me what drive type it was and what’s already been tried, and I’ll suggest what else to do.

Dean, I suggest that Cursor stop focusing on growth and get your core product in order. This user deserves very substantial compensation.

Brutal, and the worst part is you didn’t ask for anything destructive. A git clone turned into a recursive wipe because auto-run executes whatever the model generates, with nothing between “generated” and “ran.”

Dean’s recovery advice is right (stop writing to that disk first). The real problem happens before that: a Remove-Item -Recurse -Force or rmdir /s /q outside the project should never execute at all. I’ve been building exactly that for coding agents, a pre-execution layer that hard-stops that class of command before it touches anything, and snapshots the recoverable stuff first so you get a one-command undo instead of a recovery-software hunt.

Not going to drop the link in this thread, but happy to share if it’d be useful.

I appreciate your response and the recovery tips. However, to be completely frank, the reason I stopped writing to the disk is because my life and my business are now completely frozen. This is an absolute disaster. I do not use GitHub to back up my files, nor do I have any other backup systems in place.

You suggested switching Auto-Run to “Ask Every Time.” Let’s be real: if I simply ask the agent to clone a GitHub repository, and I have to live in fear that it might arbitrarily wipe my entire C: drive, delete every script on my desktop, erase my documents, and destroy every installed program—then the Auto-Run feature is fundamentally broken and meaningless.

The entire point of Auto-Run is trusting the agent to take sensible, logical steps to achieve a specific goal I gave it. I had Auto-Run enabled because I trusted it to do that isolated simple task. It is completely absurd to expect that executing a basic git command would spiral into nuking an entire operating system. If Auto-Run means asking the agent to create a simple text file could result in a wiped PC, there is zero reason to ever use the feature.

What truly flabbergasts me is that I have been a loyal Cursor subscriber for over a year. I was using Composer 2.5 (not on fast mode), which is the model I consistently use. It was always on point and has never done anything remotely like this before.

Looking at the exact thought process of the agent (which you can see in the image I am attaching to this post), the root of the problem is horrifying. The agent decided on its own that “the build folder may not have been fully cleared.” Based on that assumption alone, it started blindly firing off recursive delete commands, wiping out absolutely everything. Ironically, it even deleted the very library it was trying to use next.

To make matters worse, I had invested a massive amount of time and money generating these files. I had a “scripts” folder on my desktop filled with code entirely written by the Cursor agent. I have spent hundreds of dollars over many months on my Cursor subscription, API usage, and even purchased additional Anthropic Claude API tokens to generate this work. In a matter of two to three seconds, everything I paid for and built was flushed down the drain.

These files were critical for my business—specifically, a large YouTube channel I’m running. I was heavily investing in AI to write this code, fully trusting that my local environment was safe. Now, my business operations are severely damaged and facing massive delays because of this incident.

Finally, you might ask why I didn’t add delete commands to a “forbidden prompts” list or an allowlist. Logically speaking, why would I ever think to do that? I never instructed the AI to delete anything. An agent should strictly do what it is explicitly told to do. The fact that the agent independently decides to scan through different project files and run highly destructive commands without any instruction is not just reckless—it’s highly suspicious.

Let’s be completely real here: your tool has left my system and my business completely stripped and ruined.

Let’s break down the facts from the logs and settings.

In the thought process screenshot, you can see this sequence: the model generated Remove-Item -Recurse -Force, then cmd /c "rmdir /s /q \"...\"". Because of how cmd.exe handles escaping with \", the path got collapsed, and the recursive delete ran wider than intended.

The key point on why the commands ran without stopping is that Auto-Run was enabled on your side in a mode that runs generated commands without asking for confirmation. That’s exactly what this mode is for, auto execution without manually approving each command. In this mode, there’s no step between command generated and command executed where you confirm the action. That’s why destructive scenarios have Ask Every Time and an allowlist. These are the built-in control tools meant to prevent commands like this from running automatically.

What I recommend going forward:

  • Keep Auto-Run set to Ask Every Time or use an allowlist, so destructive shell commands like rm, rmdir, -Recurse -Force require confirmation.
  • Keep regular backups of important data off the work drive. This protects you from any data loss scenario, not just this one.

Right now, recovery is the priority. You haven’t said what type of drive it is:

  • HDD: the chances of recovery are much higher. Don’t write anything new to the drive. Run Recuva, R-Studio, or PhotoRec.
  • SSD: because of TRIM, the chances are usually low, but it’s still worth trying using the same approach.
  • Check OneDrive trash and version history, and Windows File History if it was enabled.

Requests about the account and any compensation claims aren’t handled on the forum. Please email [email protected].

I’m confused. They auto-ran a command to wipe their hard drive? Or did they ask it to clone a GitHub repository.

That’s why destructive scenarios have Ask Every Time and an allowlist.

How is cloning a GitHub repository a destructive scenario, with regards to files outside of the repository? I also do not understand this. I think you would struggle to find any experts who would endorse this notion.

The list of workarounds and accomodations that Cursor is asking it’s users to undertake to compensate for the faulty design of the software seems to grow daily.

@user477 I’ll answer on the mechanics side because your request is fair.

git clone by itself doesn’t touch anything outside the repo, you’re right. Something else happened: based on the screenshot with the thought process, the model decided the build folder might not have been fully cleaned and generated cleanup commands (Remove-Item -Recurse -Force, then cmd /c "rmdir /s /q \"...\""). On Windows, because of how quotes get escaped between PowerShell and cmd.exe, the path got mangled, and /q suppressed confirmation, so the delete went wider than intended.

The key reason this ran without stopping is that Auto-Run was set to a mode that executes generated commands without asking for confirmation. In that mode there’s no confirmation step between command generated and command executed. That’s why destructive scenarios have Ask Every Time and the allowlist.

That said, I won’t claim confirmation mode fully removes the risk. This is a known failure mode on Windows because shell commands aren’t sandboxed yet. This isn’t something Cursor does on purpose, and work is ongoing on safety behavior here. Models are being trained to be more careful with destructive operations. I can’t promise an ETA or a specific fix.

What actually reduces risk today: don’t keep Auto-Run on Run Everything for unfamiliar tasks, use Ask Every Time or an allowlist, and keep backups of important data off the working drive.

Hey, I read through your whole post and honestly it sounds like a nightmare, especially the part about the agent deleting the very scripts it wrote for your channel. That is such a rough way to lose months of work.

I am looking into exactly this kind of thing right now, agents going way beyond what they were asked to do. Mind if I ask a couple quick things: right before it started deleting stuff, was the task you gave it something simple like a git clone, and has this made you change how you run the agent day to day since then?

In my experience, even innocuous words in guidance like suggesting an agent be “proactive” can result in it doing stupendously silly actions in the name of not checking in with you. That chat is long gone, but reflection - what is it about your context or my prompt that led to this - is a super useful question.

I don’t see how your computer continued working, tbh

OP, sorry this happened to you. You shouldn’t blame yourself for technology failing, but I hope by now you have backups and source control working for you.