claude-code
claude-code copied to clipboard
Compaction creates new conversation files, causing confusing behavior with --resume
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
- Start a conversation in a project with
claude -r - Work for an extended period until compaction is triggered
- Exit and run
claude -ragain - 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
--resumeshould only show the most recent conversation in a compaction chain (followingparentUuidlinks)
Actual Behavior
- Each compaction creates a new
.jsonlfile with a different UUID --resumeshows all these files as separate conversation options- Users are confused because they always used
-rbut 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)