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)

5.8medium
April 10, 2026Reproducible
  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.

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

Related incidents

Get told when an agent breaks something

We document AI agent failures daily, severity-scored against a published scale. When one lands at 7.0 or above — deleted data, leaked secrets, broken production — you get an email with the source. When nothing does, you get nothing.

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