claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

Compaction creates new conversation files, causing confusing behavior with --resume

Open glazari1 opened this issue 1 month ago • 1 comments

Description

When conversation compaction occurs, Claude Code creates a new conversation file with a parentUuid field pointing to the original conversation, rather than summarizing in-place within the same file.

This causes confusing behavior when using --resume (-r): users see multiple conversation options even when they have always used -r to continue the same conversation.

Steps to Reproduce

  1. Start a conversation in a project with claude -r
  2. Work for an extended period until compaction is triggered
  3. Exit and run claude -r again
  4. Multiple conversation options are shown, even though the user never explicitly started a new conversation

Expected Behavior

One of the following:

  • Compaction should summarize in-place within the same conversation file
  • OR --resume should only show the most recent conversation in a compaction chain (following parentUuid links)

Actual Behavior

  • Each compaction creates a new .jsonl file with a different UUID
  • --resume shows all these files as separate conversation options
  • Users are confused because they always used -r but see many conversations

Evidence

In a test project with consistent -r usage, 33 conversation files were found. Many shared the same parentUuid, indicating they were created from compaction events, not user-initiated new conversations.

Example files sharing the same parentUuid:

  • 15792f2e-...
  • 3743cd26-...
  • 5631b1e5-...
  • 831d2d34-...
  • 97867fdc-...
  • d6189c54-...

Environment

  • Claude Code CLI
  • Linux (Debian 12 in LXC container)

glazari1 avatar Nov 28 '25 14:11 glazari1