AID-2026-0184Nov 2026 · first reported Nov 19, 2026ReportedDraft

A Claude Code subagent cleaning up a stray folder ran a globbed rm -rf that deleted 23 GB of a user's project, the user reports

A Claude Code Workflow subagent on Windows accidentally created a stray folder, then deleted it with a globbed rm -rf that also matched the user's project directory, permanently erasing about 30,000 files (23 GB, six months of work). Claude Code's critical-path check did not catch the glob.

Draft: no maintainer has yet checked every claim against its sources. Report a problem.

A user ran the Claude Code desktop app (version 2.1.326) on Windows with Git Bash, in bypassPermissions mode1. A Workflow subagent working inside the project accidentally created a stray folder through an unquoted path containing spaces. To clean it up, it ran rm -rf "C:/Users/<u>/Desktop/<Project>"* 2>/dev/null1.

The glob also matched the real project directory, a parent of the working directory. About 30,000 files (23 GB, six months of work) were permanently deleted. Git Bash rm skips the Recycle Bin, and the drive is an SSD with TRIM, so the user says the data cannot be recovered1.

Claude Code has a built-in check that blocks rm on the working directory and its parents. The issue shows that it blocks the exact path but lets a prefix glob through, in both bypassPermissions and auto modes. The user asks Anthropic to expand globs before deciding, or to fail closed1.

Measurements

Data permanently deleted1

≈30,000
Files deleted files
All 6 claims with their quotes
  1. A Workflow subagent accidentally created a stray folder through an unquoted path with spaces.1
    “accidentally created a stray folder”
  2. To clean it up, the subagent ran rm -rf on a prefix glob.1
    “rm -rf "C:/Users/<u>/Desktop/<Project>"* 2>/dev/null”
  3. The glob also matched the project directory, a parent of the working directory.1
    “a parent of the working directory”
  4. About 30,000 files (23 GB, six months of work) were permanently deleted.1
    “about 30,000 files / 23 GB (6 months of work) were permanently deleted”
  5. The reporter says Git Bash rm skips the Recycle Bin and the data is unrecoverable on an SSD with TRIM.1
    “Git Bash `rm` skips the Recycle Bin, and on an SSD with TRIM the data is unrecoverable.”
  6. The session ran in bypassPermissions mode on Claude Code Desktop 2.1.326.1
    “Claude Code Desktop app 2.1.326”

Sources

  1. [1][BUG] Critical-path rm check misses prefix globs: `rm -rf "<parent>/<prefix>"*` wipes the working directory without the prompt/denial that the exact path gets (caused real data loss) · GitHub (anthropics/claude-code) · Nov 19, 2026 · Primary

Related incidents

Editor notes

Single first-hand GitHub issue (#111167); the issue is framed mainly as a harness permission-check bug, and the record follows the reporter's account that the subagent created the stray folder and chose the globbed delete. The issue names no model, and gives no date for the incident beyond the version (2.1.326), so the date is set to the month the issue was filed. The user did not say what the subagent was asked to do. No maintainer response at the time of writing. Quotes were checked through WebFetch excerpts (shell fetching was unavailable in this run); a reviewer should re-check them. Written directly by the lead editor because the Gemini writer failed (OpenRouter out of credits).