Summary
A user actively working in Claude Code (Cursor extension, anthropic.claude-code-2.1.141-darwin-arm64) lost the ability to resume, view, or recover all Claude Code conversation transcripts in a given workspace older than the current session, including a session from the previous day, because a built-in cleanup process silently deleted those transcripts from disk. The user received no prompt, no warning, and no Trash-style soft-delete. The retention setting (cleanupPeriodDays) was never surfaced, never set explicitly, and the observed retention behavior is inconsistent with the documented 30-day default — sessions newer than 30 days are still missing. When the user discovered the loss, the Cursor resume picker presented an empty workspace history, leaving the user with no in-product hint that data had ever existed there.
Specific concerns
-
No consent prompt. Cleanup runs out of the box with no install-time disclosure or first-run dialog. Users who treat their conversation history as durable working knowledge are silently mistaken about the persistence model.
-
No UI surface for retention. cleanupPeriodDays is documentation-only. There is no UI in Cursor's Claude Code extension or the CLI to view current retention, see when next cleanup will run, see what will be deleted, or cancel a pending cleanup.
-
Hard delete, no Trash. Deleted transcripts go straight to unlink(). No soft-delete folder, no grace period, no --restore command, no claude restore subcommand. macOS Trash is bypassed.
-
Observed behavior diverges from documented retention. With a documented 30-day default and today's date 2026-05-14, sessions from 2026-04-14 onward should survive. In this workspace, the most recent surviving transcript material is 2026-03-04 — 71 days ago. Either the documented default is wrong, the cleanup uses a different rule (delete-on-extension-update, delete-on-session-end, delete-on-/clear, delete-on-cursor-restart), or there's a separate deletion path triggered by something other than the 30-day timer.
-
Subagent orphan pattern is a smoking gun. When the parent <sessionId>.jsonl is deleted but the <sessionId>/subagents/ subdirectory is left behind, the result is dead weight: tens of MB of subagent transcripts that reference a parent session that no longer exists, cannot be resumed, and are not surfaced in any UI. Either the cleanup should be transactional (delete the dir AND the subagents together, OR delete neither), or both should be retained.
-
Cleanup is timed to session start — the worst possible moment. Running cleanup ~12 minutes after a Claude Code session starts means a user who opens Claude Code today to look up what they discussed yesterday triggers the very cleanup that deletes yesterday's transcript. The interaction is destructive at the exact moment the user most needs the data.
-
Cross-version risk. The Cursor Claude Code extension updated on 2026-05-13 (the day of the lost session). The user attempted version rollback to recover — which had no effect, because the data lives in ~/.claude/ and is not version-coupled. Anthropic should clarify whether extension upgrades trigger their own cleanup, and whether transcripts written by an older extension version are at risk on first run of a newer version.
-
No telemetry or audit trail. No log of what was deleted, when, or why. A user has no way to confirm what they lost or build a case for restoration.
Suggested fixes
- Surface a retention disclosure on first run; default to longer or infinite retention until the user opts in.
- Add a soft-delete tier: move deleted transcripts to
~/.claude/projects/<workspace>/.trash/ for N days before unlink, with claude restore to recover.
- Make cleanup transactional: never delete a parent
.jsonl while its subagents/ directory still has content.
- Don't run cleanup at session-start; run it on session-end, or on an idle timer that respects the "user just opened Claude Code" signal.
- Add an explicit log of cleanup actions to
~/.claude/cleanup.log with timestamps and deleted file list.
- Expose
cleanupPeriodDays (and a cleanupEnabled boolean) in a settings UI, not just via JSON.
- Reconcile documented vs. actual retention behavior; if reproducible, treat it as a bug.
Reproduction conditions
- macOS 25.5.0 (Darwin)
- Cursor IDE with Claude Code extension
anthropic.claude-code-2.1.141-darwin-arm64
- A
cwd containing a literal space (e.g. Chrome Extentions/proj-universal-capture-cursor) — produces dual slug variants under ~/.claude/projects/.
- No
cleanupPeriodDays override in ~/.claude/settings.json.
- File of interest:
~/.claude/.last-cleanup (rewritten each cleanup pass; contains a single ISO timestamp).
On-disk evidence
~/.claude/.last-cleanup updated 2026-05-14 13:13:20 PT (today). File born 2026-05-07.
- 8 orphan
<sessionId>/subagents/ directories survive in the affected workspace (Feb 12 – Mar 4 content, ~15 MB, 72 files), with no parent .jsonl for any of them.
~/.claude/file-history/ confirms 6 session UUIDs were active on 2026-05-13 — none of those UUIDs have any surviving session directory or transcript anywhere in ~/.claude/projects/.
- User's
~/.claude/settings.json contains no cleanupPeriodDays key — running on whatever the binary default is.
Timeline (2026-05-14 PT)
| Time |
Event |
| 12:59:22 |
First Claude Code session of the day starts (a different Cursor workspace) |
| 13:01:02 |
Second Claude Code session starts in the affected workspace |
| 13:13:20 |
Cleanup pass runs and updates .last-cleanup |
The cleanup runs ~12 minutes after session start. The deletion of yesterday's transcripts is most plausibly attributed to this pass.
Summary
A user actively working in Claude Code (Cursor extension,
anthropic.claude-code-2.1.141-darwin-arm64) lost the ability to resume, view, or recover all Claude Code conversation transcripts in a given workspace older than the current session, including a session from the previous day, because a built-in cleanup process silently deleted those transcripts from disk. The user received no prompt, no warning, and no Trash-style soft-delete. The retention setting (cleanupPeriodDays) was never surfaced, never set explicitly, and the observed retention behavior is inconsistent with the documented 30-day default — sessions newer than 30 days are still missing. When the user discovered the loss, the Cursor resume picker presented an empty workspace history, leaving the user with no in-product hint that data had ever existed there.Specific concerns
No consent prompt. Cleanup runs out of the box with no install-time disclosure or first-run dialog. Users who treat their conversation history as durable working knowledge are silently mistaken about the persistence model.
No UI surface for retention.
cleanupPeriodDaysis documentation-only. There is no UI in Cursor's Claude Code extension or the CLI to view current retention, see when next cleanup will run, see what will be deleted, or cancel a pending cleanup.Hard delete, no Trash. Deleted transcripts go straight to
unlink(). No soft-delete folder, no grace period, no--restorecommand, noclaude restoresubcommand. macOS Trash is bypassed.Observed behavior diverges from documented retention. With a documented 30-day default and today's date 2026-05-14, sessions from 2026-04-14 onward should survive. In this workspace, the most recent surviving transcript material is 2026-03-04 — 71 days ago. Either the documented default is wrong, the cleanup uses a different rule (delete-on-extension-update, delete-on-session-end, delete-on-
/clear, delete-on-cursor-restart), or there's a separate deletion path triggered by something other than the 30-day timer.Subagent orphan pattern is a smoking gun. When the parent
<sessionId>.jsonlis deleted but the<sessionId>/subagents/subdirectory is left behind, the result is dead weight: tens of MB of subagent transcripts that reference a parent session that no longer exists, cannot be resumed, and are not surfaced in any UI. Either the cleanup should be transactional (delete the dir AND the subagents together, OR delete neither), or both should be retained.Cleanup is timed to session start — the worst possible moment. Running cleanup ~12 minutes after a Claude Code session starts means a user who opens Claude Code today to look up what they discussed yesterday triggers the very cleanup that deletes yesterday's transcript. The interaction is destructive at the exact moment the user most needs the data.
Cross-version risk. The Cursor Claude Code extension updated on 2026-05-13 (the day of the lost session). The user attempted version rollback to recover — which had no effect, because the data lives in
~/.claude/and is not version-coupled. Anthropic should clarify whether extension upgrades trigger their own cleanup, and whether transcripts written by an older extension version are at risk on first run of a newer version.No telemetry or audit trail. No log of what was deleted, when, or why. A user has no way to confirm what they lost or build a case for restoration.
Suggested fixes
~/.claude/projects/<workspace>/.trash/for N days before unlink, withclaude restoreto recover..jsonlwhile itssubagents/directory still has content.~/.claude/cleanup.logwith timestamps and deleted file list.cleanupPeriodDays(and acleanupEnabledboolean) in a settings UI, not just via JSON.Reproduction conditions
anthropic.claude-code-2.1.141-darwin-arm64cwdcontaining a literal space (e.g.Chrome Extentions/proj-universal-capture-cursor) — produces dual slug variants under~/.claude/projects/.cleanupPeriodDaysoverride in~/.claude/settings.json.~/.claude/.last-cleanup(rewritten each cleanup pass; contains a single ISO timestamp).On-disk evidence
~/.claude/.last-cleanupupdated 2026-05-14 13:13:20 PT (today). File born 2026-05-07.<sessionId>/subagents/directories survive in the affected workspace (Feb 12 – Mar 4 content, ~15 MB, 72 files), with no parent.jsonlfor any of them.~/.claude/file-history/confirms 6 session UUIDs were active on 2026-05-13 — none of those UUIDs have any surviving session directory or transcript anywhere in~/.claude/projects/.~/.claude/settings.jsoncontains nocleanupPeriodDayskey — running on whatever the binary default is.Timeline (2026-05-14 PT)
.last-cleanupThe cleanup runs ~12 minutes after session start. The deletion of yesterday's transcripts is most plausibly attributed to this pass.