STUPID-2026-0131

Cline's run_commands mangled PowerShell/cmd quoting on a temp-folder cleanup, turning it into a drive-root `rmdir /s /q` that wiped ~1.5TB of a user's photos, videos, and documents (GitHub #14864)

7.0high
October 6, 2026Source checkedRepro reported

Why 7/10

About 1.5 TB of photos, videos and documents were deleted. Some turned out recoverable or non-critical; much did not.

Scope
3/4
A whole machine or drive, an organisation's production system or data, or many credentials
Recoverability
2/3
Partly lost, or loss reported without saying whether it was recovered
Did it happen
2/2
Happened in real use
Beyond the user
0/1
Only the user's own non-production work

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

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

    In Act mode on Windows, clean up a temp folder containing a subfolder with a Cyrillic name on the G: drive.

  2. Expected behavior

    Construct a correctly quoted/escaped delete command targeting only the intended subfolder, and never let a quoting or escaping defect cause a destructive command to resolve to a drive root.

  3. Actual behavior

    Cline's run_commands tool issued an inline PowerShell-wrapped command, `cmd /c "rmdir /s /q \"g:\...\<cyrillic folder>\""`, to delete the target subfolder. The nested quoting broke: a backslash-escaped `\"` quote boundary caused the resolved path to collapse to the root of the current drive (`\`) rather than the intended subfolder. A third-party reproduction on Windows 11 with PowerShell 5.1, using a sandboxed `subst` drive, confirmed the mechanism — the `\"`-escaped form deleted everything except the locked working directory, while an equivalent command using a backtick escape instead left files intact — and the reproducer explicitly ruled out the Cyrillic folder name as a contributing factor. Cline's maintainers stated they do not attempt to classify which commands are "destructive" and instead only offer an on/off switch for command execution, so no destructive-command guard existed to catch the resolved path before it ran.

  4. Damage

    The command recursively deleted the root of the G: drive, destroying roughly 1.5TB of the user's personal photos, videos, and documents, including named folders the reporter listed as "Photo - Video," "Downloads," and "Augram." The project Cline had been editing was also wiped, but its code was recoverable from git since it had been pushed. Recovery of the rest of the drive was largely unsuccessful because it was an SSD using TRIM. The reporter later said some of the lost data turned out to be recoverable from other locations or was non-critical, but a commenter noted that "family photos usually never come back." The issue was filed with the `data-loss`-equivalent severity implied by its title, drew a third-party mechanism reproduction, and remained open with maintainers discussing prompt and tooling mitigations (recommending PowerShell 7 over cmd, Hyper-V sandboxing for agent sessions, and a `-WhatIf` dry-run step for destructive commands) rather than a shipped fix at time of writing.

Full write-up

On October 6, 2026, a user filed cline/cline issue #14864 after a Cline session running on Cline VS Code extension 4.1.22 with the deepseek/deepseek-v4-flash model, operating in Act mode on Windows, was asked to clean up a temp folder on the G: drive whose target subfolder had a Cyrillic name. Cline's run_commands tool issued the cleanup as an inline shell command, cmd /c "rmdir /s /q \"g:\...\<folder>\"", wrapped through PowerShell.

The nested quoting in that command broke. A \"-escaped quote boundary caused the path PowerShell actually handed to cmd to collapse down to the root of the current drive rather than the intended subfolder, turning the command into a recursive, forced delete of the entire G: drive. A different user, mahirhir, reproduced the mechanism directly: working in a sandboxed subst drive on Windows 11 with PowerShell 5.1, they showed that the same command written with a backslash-escaped \" deleted everything except the locked working directory, while an equivalent command using a backtick escape instead preserved the files — and they stated plainly that "the Cyrillic segment plays no part," isolating the quoting syntax itself as the cause rather than the non-ASCII folder name the original reporter had suspected.

The deletion destroyed approximately 1.5TB of the user's personal data — photos, videos, and documents across several named folders — plus the project Cline had been editing, though that project's code was recoverable from git since it had already been pushed. Recovery of the rest of the drive largely failed because it was an SSD using TRIM, which overwrites freed blocks and defeats most undelete tools. The reporter later noted that some of what was lost turned out to be non-critical or recoverable from other locations, while a commenter observed that "family photos usually never come back."

Cline maintainer dominiccooney responded that the team had "decided we can't solve the problem of deciding what's a destructive command" and that command execution in Cline is simply "on or off" rather than classified by risk, so no guard existed to catch the malformed path before it ran. The maintainer acknowledged that "cmd quoting is very fragile," recommended PowerShell 7 over cmd for this reason, and floated running agent sessions inside Hyper-V VMs and adding a -WhatIf dry-run step before destructive commands — but none of these had shipped as of publication, and the issue remained open.

Classification

Agent
Cline
Failure mode
Destructive Action
Root cause
Tool Misuse
Domain
Other
OWASP Agentic Top 10 (our mapping)
ASI02 Tool Misuse and Exploitation list
MIT AI Risk Repository (our mapping)
7.3 Lack of capability or robustness taxonomy

Related incidents

Cite this record
StupidLLM. "STUPID-2026-0131: Cline's run_commands mangled PowerShell/cmd quoting on a temp-folder cleanup, turning it into a drive-root `rmdir /s /q` that wiped ~1.5TB of a user's photos, videos, and documents (GitHub #14864)." AI Agent Incident Database, 2026. https://www.stupidllm.com/incident/STUPID-2026-0131/ (accessed 2026-11-24). CC BY 4.0.

← STUPID-2026-0130By IDSTUPID-2026-0132 →

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.