[BUG] Default cleanupPeriodDays silently deleted 58 of 69 session transcripts; sidebar shows ghost entries with "Session not found on disk"

Status Fixed / completed
Reported on v2.1.232
Maintainer reply None cached
Activity 3 comments · opened Aug 14, 2026 · closed Aug 25, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

Environment

  • Claude Code desktop app on macOS (Apple Silicon)
  • Max plan, desktop-app-only usage (no CLI installed until today)
  • Transcripts: ~/.claude/projects/<project>/<uuid>.jsonl
  • Sidebar metadata: ~/Library/Application Support/Claude/claude-code-sessions/<uuid>/<uuid>/local_*.json

Summary
The default cleanupPeriodDays: 30 permanently deleted the transcript .jsonl files of 58 of my 69 sessions (spanning 2026-03-28 to 2026-07-05) based on file mtime, with no notification, no opt-in, and no exposure of the setting anywhere in the desktop UI. The sidebar metadata was left behind, so all 58 sessions continued to be listed as available; clicking any of them shows "Session not found on disk" with no explanation or recovery option.

Verification performed

  • Enumerated all 69 local_*.json sidebar records and cross-checked each cliSessionId against the .jsonl files actually present under ~/.claude/projects/: 11 transcripts exist, 58 are gone.
  • ~/.claude/.last-cleanup confirms the cleanup routine is active (last run 2026-08-14T16:25Z).
  • The survival pattern matches mtime-based deletion exactly: every surviving transcript was modified within the last ~30 days (sessions I happened to reopen recently survived regardless of creation date; untouched ones were swept regardless of importance).
  • Some deleted sessions' sidebar records still carry a cliSessionId pointing at a nonexistent file; others are flagged transcriptUnavailable — so the ghost-entry state is inconsistent as well.

What Should Happen?

Session transcripts persist unless the user opts into cleanup; or, at minimum: prominent disclosure of the retention window, a warning before deletion, removal of sidebar entries whose transcripts are deleted, and an export/archive affordance.

Error Messages/Logs

Session not found on disk
Send a message to start fresh in this directory.

Steps to Reproduce

  1. Use the Claude Code desktop app normally for 30+ days without touching older sessions.
  2. Allow the default cleanupPeriodDays: 30 to remain unset/default.
  3. Click any sidebar session older than ~30 days (by last modification).

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

CLI: 2.1.232 — but issue observed in desktop app version 1.30096.1

Platform

Other

Operating System

macOS

Terminal/Shell

Other

Additional Information

Impact
Months of professional work history permanently lost with no warning (I am a university professor; these sessions covered a full semester of course development). The only reason the damage was contained is that my workflow wrote session outcomes to status files in the repo — the product itself provided no protection.

Requests

  1. Change the default to no cleanup, or make it opt-in with clear disclosure in the desktop UI.
  2. When cleanup does run, remove or visibly mark the corresponding sidebar entries instead of leaving ghosts.
  3. Add a pre-deletion warning and/or an export option.
  4. Proactively notify desktop users of the current behavior before more data is lost.

Additional context

  • Issue observed entirely in the desktop app (entrypoint: claude-desktop); the CLI was only installed today for diagnostics, so Terminal/Shell above is not really applicable.
  • Full session ledger available: 69 sidebar records enumerated, 58 with missing transcripts, survival pattern exactly matching mtime-based 30-day cleanup.
  • Related issues: #62959, #61608, #63082. This report adds a fully quantified dataset (69 sessions, exact survivor/loss split, .last-cleanup timestamp).
  • A support ticket has also been filed via support.claude.com (can cross-reference the ticket number on request).

View original on GitHub ↗

3 Comments

aron-intframe · 2 months ago

Same outcome on a different platform and a different client, which suggests the deletion path is not desktop-specific. Linux, CLI only, no desktop app installed.

I run six accounts as six CLAUDE_CONFIG_DIR roots. Five of them carry no settings.json override, so they sit on the default. All six truncate at the same boundary:

root      oldest surviving transcript   files   size    cleanupPeriodDays
aron      2026-07-22                     1992   3.6G    (365, set today)
bjpang    2026-07-22                      705   1.4G    unset
int       2026-07-22                     1341   1.5G    unset
main      2026-07-23                      906   934M    unset
power     2026-07-27                      491   1.4G    unset
zava      2026-07-23                      813   675M    unset

Today is 2026-08-15. Six independently-populated roots, one shared cutoff around three weeks back, and ~/.claude/.last-cleanup stamped this morning. Note the aron root reads 365 only because I raised it today, after the loss; it was on the default while the deletion happened, like the rest.

Two things worth adding to the report:

The loss is not recoverable from anywhere local. I needed four months of usage history this week and none of it existed on disk. What made it recoverable at all was that aggregates had been submitted to a third-party leaderboard months earlier, so I could reconstruct daily and per-model figures from a public profile. Anyone who has not published their usage somewhere has no path back. That seems worth weighing against the current default, since transcripts are the only local record of what an account actually did.

Retention is by file mtime, so it deletes by last-touched rather than by conversation age. A long-running session that gets resumed keeps resetting its own clock and survives indefinitely, while a short session from the same afternoon is gone. The set that survives is therefore not "the last N days of work" but "whatever happened to be written to recently", which is a harder property to reason about than a straight age cutoff.

What I would want, in rough order of value: a one-time prompt or a startup warning before the first deletion rather than after; the setting surfaced somewhere a user can find it without reading the docs; and a default higher than 30 for .jsonl transcripts specifically, since they are small relative to what they represent. Mine total 9.4G across six accounts and four months, which is not a lot to keep for the only record of the work.

inaki-longarela · 1 month ago

Thank you — this confirms the pattern precisely. My case (desktop app, macOS, single account): 58 of 69 sessions gone, and the survivors match your mtime observation exactly — sessions I happened to reopen recently survived regardless of age, while untouched ones from the same weeks were deleted. So we have the same boundary behavior on macOS/desktop and Linux/CLI across seven config roots total. I've also filed this with Anthropic support (conversation ID 215475490441586), referencing this issue.

+1 to your remediation order. I'd add: when cleanup deletes a transcript, the desktop app's corresponding sidebar entry should be removed or marked — currently it advertises the deleted sessions indefinitely, so users discover the loss only when recovery is impossible.

inaki-longarela · 1 month ago

@codebytere-ant Could you clarify what "completed" refers to here? There is no linked PR, no closing comment, and no version mentioned. Specifically: (a) has any of the reported behavior changed (the silent default, the missing pre-deletion warning, the ghost sidebar entries), and in which release? (b) If the resolution is tracked elsewhere, could you link it? Given that this thread documents multi-month data loss across two platforms and had #87748 marked as its duplicate, a one-line disposition would help the users still exposed to the default.