[BUG] Windows desktop: all session transcripts deleted from ~/.claude/projects on first launch after 2.1.177 update — recents show "session not found on disk"

Open 💬 2 comments Opened Jun 17, 2026 by updawg

Preflight Checklist

  • [x] I have searched existing issues — this appears to be a recurrence of #62959 / #63082 / #63839 on a newer build (those are 2.1.144–2.1.149 / May; this is 2.1.177)
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

On Windows 11, the desktop app auto-updated to the 2.1.177 bundle overnight (2026-06-16 21:10). On the first launch the next morning, nearly all session transcripts under %USERPROFILE%\.claude\projects\<slug>\*.jsonl were deleted in a single pass (every project folder's mtime changed within the same second, ~10:53). Only the live session survived. The sidebar/recents still lists the deleted sessions, so every click shows "session not found on disk." Deletes were permanent unlinks — no Recycle Bin.

This is not the cleanupPeriodDays 30-day cleanup, despite that being the common assumption (#62959). I traced the cleanup in the 2.1.165 binary:

  • The age-based sweep only deletes logs, paste-cache, backups, daemon files, and stale worktrees. There is no age-based routine that deletes projects/*.jsonl transcripts; the only transcript delete removes a single session by ID.
  • Many deleted transcripts were 1–2 days old (e.g. June 15 files gone June 17) — a 30-day rule can't do that.
  • The age cleanup had run since mid-May (.last-cleanup created 5/14) without ever removing a transcript.

The deletion coincided exactly with the 2.1.177 update + first launch, which matches the launch-time "startup scanner" behavior in #63082 — except on Windows it unlinks the actual .jsonl files (true data loss), not just the cliSessionId metadata.

Likely Windows aggravator: .claude.json stored each project under four drive-letter/separator variants (C:\, c:\, C:/, c:/), and the on-disk slug folders were split between C--… and c--…. Inconsistent casing normalization during a session↔disk reconciliation could mark valid sessions as orphaned and remove them.

What Should Happen?

The app must never delete user conversation transcripts without explicit user action and confirmation. Deletions should be soft (Recycle Bin / trash), and the recents index must stay in sync with on-disk files.

Error Messages/Logs

UI: "Session not found on disk"
~/.claude/.last-cleanup written 2026-06-17T14:52:37Z; all ~/.claude/projects/* folder mtimes = 2026-06-17 10:53
Pre-recovery: 2 of ~N .jsonl remained machine-wide (both the live session)
No explicit deletion entry surfaced in %APPDATA%\Claude\logs

Steps to Reproduce

  1. Use Claude Code Desktop (Windows) over time; accumulate sessions across several projects.
  2. Let the desktop app auto-update (here: to the 2.1.177 bundle).
  3. Launch for the first time on the new build.
  4. Observe ~all %USERPROFILE%\.claude\projects\<slug>\*.jsonl deleted (only the live session remains); recents still list them → "session not found on disk."

Note: tied to the update/scanner, so not reliably reproducible on demand; diagnostic evidence above provided in lieu.

Claude Model

Not sure / Multiple

Is this a regression?

Yes, this worked in a previous version

Last Working Version

Worked through 2026-06-16 (pre-2.1.177 desktop bundle); CLI 2.1.165

Version

CLI 2.1.165; Desktop bundle 2.1.177; Windows 11 Pro; entrypoint claude-desktop

---

Recovery (for others hit by this): permanent unlink but clusters weren't overwritten yet → Recuva recovered the .jsonl with original names/timestamps. Each transcript records its own cwd per line, so map each back to …\.claude\projects\<slug>\ (slug = cwd with every non-alphanumeric char → -). Recovered 23/24.

View original on GitHub ↗

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