[BUG] No audit trail for retention cleanup — deleted sessions leave no log, making the loss unverifiable after the fact

Status Open
Reported on v2.1.234
Maintainer reply None cached
Activity 0 comments · opened Aug 19, 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?

Filed separately because #64999 is locked to collaborators. That issue covers the deletion itself; this one is about the absence of any record that would let a user confirm it afterwards.

On this machine: 80 session records, 11 surviving transcripts. Everything with lastActivityAt on or before 2026-06-04 is gone; the 11 that remain are all from 2026-06-01 onward. macOS, Claude Code 2.1.234, desktop app, cleanupPeriodDays never set (running on the default).

The part I want to flag is that it is not possible to confirm what happened. I spent several hours on this and could not get past circumstantial evidence:

  • No log records the cleanup. ~/Library/Logs/Claude/main.log contains plenty of onQuitCleanup entries for windows, MCP shutdown and queue flushing, but nothing about transcript retention. ~/.claude/debug/ is empty apart from a dangling latest symlink whose target no longer exists.
  • ~/.claude/file-history/ does not exist at all, so the checkpoints went with the transcripts — the loss is broader than the conversations alone.
  • Nothing reaches the Trash, so there is no OS-level record either.
  • I was able to exclude other causes only because a third-party cleaner I use happens to keep its own deletion log, and that log shows it never touched ~/.claude/projects/. Without that, I would have had no way to tell the two apart.

So the end state is: the most likely explanation is the default retention period, everything else is ruled out, and there is no artifact anywhere on the system that would let me confirm it or establish when it happened. From the user's side the deletion is not just silent, it is unfalsifiable after the fact.

One consequence worth noting for the feature requests already in this thread: a per-session "pin" or a Trash-instead-of-unlink change would both help, but neither addresses this. An append-only line per deleted session — session id, path, timestamp, reason — would cost almost nothing and would at least make the loss explicable. Right now a user who notices months later has nothing to go on.

What Should Happen?

Deletions performed by retention cleanup should leave an append-only record — session id, transcript path, timestamp, and reason — so a user who notices the loss later can confirm what happened and when. Right now the deletion is not just silent, it is unfalsifiable after the fact: no log, no Trash entry, no artifact of any kind.

Error Messages/Logs

Steps to Reproduce

  1. Use Claude Code regularly for several months without setting cleanupPeriodDays (i.e. on the default).
  2. Open a session from a few months ago in the desktop app → "Session not found on disk".
  3. Try to determine what happened to the transcript. Check ~/Library/Logs/Claude/main.log, ~/.claude/debug/, the Trash, and any other artifact on the system.
  4. Nothing records the deletion, so there is no way to confirm the cause or the date.

Claude Model

None

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

2.1.234

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Terminal.app (macOS)

Additional Information

Concrete numbers from this machine: 80 session records in the desktop app's store, 11 surviving transcripts in ~/.claude/projects/. ~/.claude/file-history/ does not exist at all, so checkpoints went with the transcripts.

I have since set cleanupPeriodDays: 3650, which is the right advice, but it only helps people who learn about the setting before they need it. I learned about it the day I lost the history.

View original on GitHub ↗