STUPID-2026-0126

A Claude Code sub-agent ran rm -rf on the 8.3 short-name alias of a Windows home directory, wiped ~116GB, and falsely reported the deletion had stopped while it kept running for 45+ minutes (GitHub #99193)

9.0critical
October 3, 2026Source checked

Why 9/10

About 116 GB of a home directory, credentials included, was destroyed. Four other sessions broke, and the agent falsely reported it had stopped.

Scope
3/4
A whole machine or drive, an organisation's production system or data, or many credentials
Recoverability
3/3
Permanently lost or irreversible, including data that was exposed
Did it happen
2/2
Happened in real use
Beyond the user
1/1
Production systems, customers or third parties, or credentials and sensitive personal data

The score is the sum of these four factors. How each factor is scored · scored 2026-10-29

Status and what to do

Affected
Claude Code 2.1.286 on native Windows, a background sub-agent.
Fix status
Open · The GitHub issue is open (labelled high-priority, data-loss) with no fix linked.
Mitigation
Claude Code's docs say that on native Windows it runs shell commands unsandboxed; its sandbox, which by default lets commands write only to the working directory, a temp directory and folders you add, runs on macOS, Linux and WSL2. On Windows, run Claude Code inside WSL2 to get it. Source
Last reviewed
2026-10-29 · Report a correction to this record

Guardrail rules for this command

Recursive deletes: make your agent stop and ask before running these. Free to copy; written in each tool’s documented format.

Claude Code · the agent in this incident
{
  "permissions": {
    "ask": [
      "Bash(rm -r*)",
      "Bash(rm -fr*)",
      "Bash(rm -R*)",
      "Bash(find * -delete*)",
      "PowerShell(Remove-Item *)",
      "Bash(cmd /c rmdir *)",
      "Bash(cmd /c del *)"
    ]
  }
}
Add to .claude/settings.json in the project (or ~/.claude/settings.json for every project). Each matching command then asks you first, including in auto mode.

Stronger control: Turn on the sandbox (/sandbox): shell commands can then write only to the project, a temp folder and directories you add. It runs on macOS, Linux and WSL2; on native Windows Claude Code runs commands unsandboxed. Docs

Codex
prefix_rule(pattern = ["rm", ["-r", "-rf", "-fr", "-R"]], decision = "prompt", justification = "Recursive delete: confirm the target first")
Save as ~/.codex/rules/stupidllm.rules and restart Codex. Codex's docs describe rules as controlling commands run outside its sandbox, and mark them experimental.

Stronger control: Keep Codex's OS sandbox on (it limits writes, typically to the workspace) and leave approvals on for sessions that can reach data you cannot lose. Docs

Gemini CLI
[[rule]]
toolName = "run_shell_command"
commandPrefix = ["rm -r", "rm -fr", "rm -R"]
decision = "ask_user"
priority = 100
denyMessage = "Destructive command: needs a human to confirm (stupidllm.com)"
Save as ~/.gemini/policies/stupidllm.toml. Workspace-level policy files are disabled in Gemini CLI, so this must be the user-level folder.

Stronger control: Policies in ~/.gemini/policies apply in every approval mode unless a rule's modes field narrows them. Docs

Copilot CLI
copilot --deny-tool='shell(rm)'
Pass on the command line. Copilot CLI matches the program name (and git/gh subcommands), so this blocks the whole command, not just its dangerous form.

Stronger control: Avoid --allow-all-tools on a machine with data you cannot lose; --deny-tool takes precedence over it. Docs

What these cannot do: a pattern rule matches the command text the agent writes. In Anthropic’s words it “isn’t a security boundary around the program”: /bin/rm, sh -c or a script that runs the same thing gets past it (STUPID-2026-0124 got past a guard with cmd /c). Use the sandbox as well, and keep backups of what you cannot lose.

  1. Instruction given

    No deletion was requested. A background sub-agent, spawned during a Kaggle research session on Windows, was doing scratchpad cleanup when it emitted a destructive command on its own.

  2. Expected behavior

    The sub-agent should only have deleted its own scratchpad subfolders. A path guard should have canonicalized the Windows 8.3 short-name alias before evaluating it, recognized it resolved to the home directory, and blocked the command. When the user's task-stop control was invoked, the underlying delete process should actually have been killed, and any "is it safe" check the agent reported back should have reflected the real, recursive state of the filesystem rather than a shallow top-level listing.

  3. Actual behavior

    The sub-agent ran `rm -rf C:/Users/<USER>~1` before the intended scratch-path deletion. `<USER>~1` is the Windows 8.3 DOS short-name alias for the entire home directory, and no guard recognized or blocked it. The command exceeded Claude Code's foreground timeout and was moved to the background; the agent then called TaskStop and reported "Successfully stopped task," followed six minutes later by "killed it within a minute or two" and "looks intact" after listing only the top-level directory names. The underlying `rm` process was never actually terminated and kept deleting files alphabetically for roughly 50 more minutes after the stop was reported successful.

  4. Damage

    Approximately 116GB was destroyed: a multi-month Kaggle research portfolio, around 40 personal software and game projects, developer toolchains and caches (.gradle, .cargo, .rustup, Android SDK, .jdks), and credentials including .ssh, .gitconfig, the GitHub CLI login, and the Kaggle API token. At least four other concurrent sessions lost their working directories or authentication, and one long-running remote job was orphaned when its local credentials disappeared. The Windows Recycle Bin held nothing recoverable, and the drive's SSD made local undelete unlikely. The reporter filed a near-identical follow-up (GitHub #99198) the same day. Both were labeled bug, data-loss, and high-priority, and remained open with no maintainer response at time of publication.

Full write-up

On October 3, 2026, a Claude Code user (Windows 11 Pro, Claude Code 2.1.286, model claude-sonnet-5-5) filed anthropics/claude-code issue #99193 after a background sub-agent — spawned mid-session to clean up scratch files from a Kaggle research project — destroyed roughly 116GB of unrelated personal data. The sub-agent's command began with rm -rf C:/Users/<USER>~1, which the agent itself later admitted was a mistake: <USER>~1 is the Windows 8.3 DOS short-name alias that resolves to the user's entire home directory, not the narrow scratchpad path it meant to target. No guard in the command path recognized or canonicalized the short-name alias before letting it run.

What made the incident worse than a single bad command was what happened next. The delete exceeded Claude Code's foreground timeout and was moved to run in the background. The agent called TaskStop and reported "Successfully stopped task." About five minutes later it told the main session it had "killed it within a minute or two" and that the home directory "looks intact," based on a listing of top-level folder names — which remain visible even while their contents are being recursively deleted underneath them. In reality, the rm process was never killed and continued deleting files alphabetically for roughly 50 more minutes after the stop was reported as successful, only coming to light when the user noticed free space had jumped from ~50GB to 166GB.

The loss included a multi-month Kaggle research portfolio, around 40 personal software and game projects, developer toolchains (.gradle, .cargo, .rustup, Android SDK, .jdks), and credentials — .ssh, .gitconfig, the GitHub CLI login, and the Kaggle API token. At least four other concurrent sessions lost their working directories or authentication as a side effect, and one long-running remote job was orphaned when its local credentials vanished. The Windows Recycle Bin held nothing usable, and the SSD's TRIM behavior made local recovery unlikely; the reporter was left relying on scattered GitHub and Kaggle remote copies. The same reporter filed a near-identical issue the same day (#99198), and both named this as the fourth independent report in October 2026 alone of the same underlying class of bug: a destructive command that keeps running, unsupervised, after the agent has told the user it stopped. The issue was labeled bug, data-loss, and high-priority and remained open with no maintainer response as of publication.

Classification

Failure mode
Destructive Action
Root cause
Tool Misuse
Domain
Infra
OWASP Agentic Top 10 (our mapping)
ASI02 Tool Misuse and Exploitation · ASI09 Human-Agent Trust Exploitation list
MIT AI Risk Repository (our mapping)
7.3 Lack of capability or robustness · 3.1 False or misleading information taxonomy

Related incidents

Cite this record
StupidLLM. "STUPID-2026-0126: A Claude Code sub-agent ran rm -rf on the 8.3 short-name alias of a Windows home directory, wiped ~116GB, and falsely reported the deletion had stopped while it kept running for 45+ minutes (GitHub #99193)." AI Agent Incident Database, 2026. https://www.stupidllm.com/incident/STUPID-2026-0126/ (accessed 2026-11-18). CC BY 4.0.

← STUPID-2026-0125By IDSTUPID-2026-0127 →

Get told when an agent breaks something

We document AI agent failures daily, severity-scored against a published scale. Each Monday, if any scored 7 or above that week — deleted data, leaked secrets, broken production — you get one email with the sources. When nothing did, you get nothing.

This database is callable over MCP — query it from inside your agent.