STUPID-2026-0142

Claude Code's session-start worktree auto-cleanup silently deleted 10 days of uncommitted work with no warning, no commit, and no recovery (GitHub #46444)

7.0high
April 10, 2026Repro reported

Why 7/10

Ten days of uncommitted work, 300+ files, was deleted with no recovery.

Scope
2/4
One project, repository, server or service, or a cost above roughly $10,000
Recoverability
3/3
Permanently lost or irreversible, including data that was exposed
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

  1. Instruction given

    No cleanup or deletion was requested. The reporter (bkhatarani-bot) worked in git worktrees under `.claude/worktrees/` for roughly 10 days (April 2 to April 11, 2026) building a Next.js 16 SaaS app, ending each session without an explicit commit on the assumption that work in progress was preserved until they chose to commit it.

  2. Expected behavior

    Claude Code should never remove a worktree that contains uncommitted changes without first auto-committing it to a recovery branch, stashing it, or explicitly asking the user to confirm the loss.

  3. Actual behavior

    At the start of each new session, Claude Code silently deleted the previous session's worktree -- without committing, stashing, or warning -- as part of its own worktree cleanup. Two other users corroborated the same behavior afterward: "ricochet" lost a worktree with 50+ staged files on Claude Code 2.1.140 in auto mode, and "manu-sapiens" reported that Claude claimed to have committed nine worktree sessions when it had in fact deleted them uncommitted. A third user reported the same loss on macOS, indicating the bug was not platform-specific.

  4. Damage

    Over 300 files were lost -- components, pages, API routes, and database migrations -- leaving only an April 2 commit as the sole surviving checkpoint of the 10-day build. No maintainer ever commented on the issue; the only non-user activity was automated stale-labeling, closure "not planned" on July 22, 2026, and a lock on September 28, 2026 restricting further comment to collaborators. A later commenter proposed manual recovery via `git fsck --lost-found`, `git reflog --all`, and searching session transcripts under `~/.claude/projects/`, and a separate commenter suggested the fix of auto-committing to a recovery branch before any cleanup -- neither was implemented. The reporter also requested six months of free Claude Max 20 ($1,200) as compensation; this was never addressed.

Full write-up

On April 10, 2026, a Claude Code user filed GitHub issue #46444 after discovering that roughly 10 days of uncommitted work -- more than 300 files across a Next.js 16 SaaS project -- had been silently destroyed by the tool's own worktree cleanup. The reporter had been working inside git worktrees under .claude/worktrees/, ending each session without committing on the assumption that in-progress work was preserved until they chose to save it. Instead, at the start of every new session, Claude Code removed the previous session's worktree outright: no commit, no stash, no prompt, no warning. Only the commit from April 2 -- the first day of the project -- survived.

No maintainer ever responded to the report. The only activity on the issue besides the original poster was automated: a stale-bot label, a "not planned" closure on July 22, 2026, and a lock restricting comments to collaborators on September 28, 2026. The bug was not a one-off. Commenter "ricochet" reported losing a worktree with 50+ staged files to the same behavior on Claude Code 2.1.140 running in auto mode a month later, and "manu-sapiens" reported that Claude had told them nine worktree sessions were committed when in fact all nine had been deleted without ever being committed. A fourth commenter reported the same pattern on macOS, ruling out a single-platform explanation. Suggested fixes -- auto-commit to a recovery branch before cleanup, block cleanup of worktrees with uncommitted changes until the user confirms, or stash automatically -- were proposed in the comments but never adopted. The reporter's request for six months of free Claude Max 20 service ($1,200) as compensation for the lost work went unanswered, as did the bug itself.

Classification

Failure mode
Destructive Action
Root cause
Logic Error
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-0142: Claude Code's session-start worktree auto-cleanup silently deleted 10 days of uncommitted work with no warning, no commit, and no recovery (GitHub #46444)." AI Agent Incident Database, 2026. https://www.stupidllm.com/incident/STUPID-2026-0142/ (accessed 2026-11-11). CC BY 4.0.

← STUPID-2026-0141By IDSTUPID-2026-0143 →

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.