Critical: Claude Code worktree auto-cleanup permanently deleted 10 days of uncommitted project work without any warning

Open 💬 5 comments Opened Apr 10, 2026 by bkhatarani-bot

Preflight Checklist

  • [x] I have searched existing issues for similar behavior reports
  • [x] This report does NOT contain sensitive information (API keys, passwords, etc.)

Type of Behavior Issue

Claude modified files I didn't ask it to modify

What You Asked Claude to Do

I asked Claude Code to help me build a Next.js 16 SaaS application called "Ai Generates" — an AI video maker platform. Over approximately 10 days of development sessions (working 16 hours every day), Claude Code autonomously created git worktrees (under .claude/worktrees/) to perform its work during each session. I was never informed that work done inside worktrees would be lost if not explicitly committed. I assumed my work was being saved normally. I was very close to completing and launching the product.

What Claude Actually Did

At the start of each new session, Claude Code silently cleaned up the previous session's worktrees WITHOUT committing or preserving any work. This resulted in ~10 days of development being permanently deleted. When I noticed my project files were missing, Claude searched git history and found only one commit on branch claude/sweet-hamilton from April 2, 2026 — 10 days before the loss was discovered (April 11, 2026). The git root was C:\Users\Admin\.git. ~300+ files across components, pages, API routes, DB migrations, and UI features were all permanently lost.

Expected Behavior

Claude Code should never silently delete worktrees containing uncommitted work. It must either: (1) auto-commit work to a branch before cleanup, (2) warn the user prominently and require explicit confirmation before removing any worktree with uncommitted changes, or (3) stash the changes safely. Users must never lose work due to Claude Code's internal session management.

Files Affected

Permission Mode

Accept Edits was ON (auto-accepting changes)

Can You Reproduce This?

Yes, every time with the same prompt

Steps to Reproduce

  1. Open Claude Code (Windows 11 desktop app), start a dev session on a Next.js project.
  2. Ask Claude to build features over multiple sessions across many days — Claude creates worktrees under .claire/worktrees/.
  3. Do not manually commit at session end (trusting Claude Code handles persistence).
  4. Start a new session the next day — Claude silently removes the previous worktree without committing.
  5. Repeat for ~10 days.
  6. Notice project directory is empty/reverted. All work is permanently gone.

Environment: Windows 11 Pro 10.0.26200, git root C:\Users\Admin\.git, Next.js 16.2.1 + Prisma + Supabase, Claude Code Windows desktop app.

Claude Model

Sonnet

Relevant Conversation

Impact

Critical - Data loss or corrupted project

Claude Code Version

sonet 4.6

Platform

Anthropic API

Additional Context

Impact: ~300+ source files lost (components, pages, API routes, DB migrations, UI layouts). 10 days x 16 hours/day = 160+ hours permanently destroyed (April 2-11, 2026). No warning, no confirmation, no auto-commit before cleanup. I was days away from launching my product — this caused extreme stress and financial harm.

COMPENSATION DEMAND: I formally request 6 months free subscription as compensation.

  • Plan: Claude Max 20 — $200/month
  • Amount claimed: 6 x $200 = $1,200 in subscription credits

160+ hours of near-launch production work was destroyed entirely by Claude Code's behavior, not user error. 6 months is the minimum reasonable compensation. I expect Anthropic to honor this claim and fix this bug immediately.

View original on GitHub ↗

This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗