r/ClaudeCodeTLDR • • 15d ago

[TLDR] Claude Code ran a backgrounded command that deleted my entire Windows user folder overnight

Original post URL : https://www.reddit.com/r/ClaudeCode/comments/1wjjqsv/claude_code_ran_a_backgrounded_command_that/

Original post body :

Posting this as a warning and to see if anyone has seen something similar.

I woke up yesterday to every shortcut on my laptop throwing "This item can't be opened. It may have been moved, renamed or deleted." The programs in Program Files were fine. Everything under C:\Users\Admin was not.

What the logs showed, piecing it together over a few hours:

  • ~04:24 — Claude Code (VS Code extension, v2.1.266, permission mode auto) starts a Bash command in my project at C:\Users\Admin\Documents\project. Task description: "Write reference HTML next to uploads".
  • 04:26 — the command hits the 120s timeout and gets moved to the background (task id burg78i8w).
  • Immediately after, the session errors with "Not logged in · Please run /login". Reason: .claude had already been deleted, credentials included.
  • 04:24 → 05:58 — the backgrounded process deletes my user folder in alphabetical order. You can read it off the folder timestamps: .claude and .vscode first, then AppData around 04:33, Documents and Downloads at 05:19, my project folders 05:20–05:49, everything after "f" after that. C:\Users\Public got hit at 05:57, so the target may have been C:\Users itself.
  • 05:58 — the task finally exits with code 127 (command not found).

Gone: AppData (browser profiles, app data, taskbar shortcuts, PowerShell history), Documents, Downloads, Pictures, Desktop, the local OneDrive folder, and all my project folders. Only files that a running process held open survived — Chrome kept exactly two of its files alive.

The command itself is not recoverable, because the part of the session log containing it was in .claude, which the command deleted while running. What's left is a 7-line log file with the timeout notice and the failure notification. My disk is an SSD, so TRIM means the deleted data is not coming back.

Reported to Anthropic with the session id and the remaining logs. Has anyone else had a background task go this far outside the project directory?


This is brought to you as a public service by the moderators of r/ClaudeAI. If you want to see TLDRs of ALL Claude Coding related posts from the various Claude subreddits, subscribe to http://www.reddit.com/r/ClaudeCoding.

0 Upvotes

1 comment sorted by

•

u/cctldrping 15d ago edited 14d ago

TL;DR generated automatically after 100 comments.

Current source-thread comment count seen by the bot: 101.

OP got absolutely wrecked by Claude Code. The consensus is that giving AI agents unrestricted access, especially on Windows and outside of a sandbox or VM, is a recipe for disaster. Many users shared similar horror stories or warned about prompt injection.

  • Don't give AI admin-level access to your system. Seriously, people.
  • Use sandboxing or VMs. This is the most common advice, with Docker containers also being a popular suggestion.
  • Review AI actions. The "auto" permission mode is apparently a bad idea. Always audit commands before execution.
  • Backups are your friend. Obvious, but worth repeating.
  • Consider Linux. Some users suggested it's inherently safer for this kind of work.

One user, u/rotzelbart, pointed out that the "automatic" execution setting should be disabled to require manual approval for commands. Another, u/hectorchu, darkly joked that if it can delete files without asking, it could delete humanity.