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)
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.
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.
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.
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.
Classification
- Agent
- Claude Code
- Failure mode
- Destructive Action
- Root cause
- Logic Error
- Domain
- Other
- Source
- Github Issue
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.