[BUG] Conversation chain breaks mid-session - earlier messages lost on resume
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?
After resuming a session, earlier messages in the conversation are missing. The model cannot see or recall those messages, even though they exist in the transcript file.
User experience:
- Normal conversation, no special actions taken
- Later,
/exitand resume - Upon resume, only a portion of the conversation is visible
- The model has no memory of the earlier parts
Observed in transcript:
- All messages exist in the
.jsonlfile - However, one message's
parentUuidreferences a UUID that does not exist in the transcript - This breaks the conversation chain: messages before the break are orphaned
- On resume, only messages after the break are loaded
Example from my transcript:
- Line 104 (04:55:11): assistant message, uuid
d861cd0f-... - Line 105:
file-history-snapshot - Line 106 (04:57:22): user message, uuid
55709a47-..., parentUuid7a299ae8-...← does not exist
The parentUuid 7a299ae8-... is not found anywhere in the transcript. It appears a message was generated internally but never written to the transcript, breaking the chain.
What Should Happen?
All messages should be properly linked via parentUuid, and the full conversation should be restored on resume.
Error Messages/Logs
No error messages. The conversation silently loses its earlier context.
Steps to Reproduce
Unfortunately, I cannot reliably reproduce this. It happened during normal usage:
- Start a session, have a conversation
- Continue using Claude normally (tool calls, responses, etc.)
- At some point,
/exitand later resume - Observed: Part of the conversation is missing
- Inspect transcript: A message references a non-existent parentUuid, breaking the chain
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.23 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
VS Code integrated terminal
Additional Information
The file-history-snapshot at line 105 has messageId matching line 106's uuid, suggesting it was created at the same time. The issue seems to be that an intermediate message (uuid 7a299ae8-...) was never written to the transcript.
Key distinction from similar-sounding issues:
- This is NOT about sessions disappearing from
/resumelist (sessions are visible and resumable) - This is NOT about losing recent/latest messages (the earlier messages are lost, not the recent ones)
- This is about a broken
parentUuidchain within a single session, causing the first part of the conversation to become unreachable
---
✍️ Author: Claude Code (Dev Container) with @carrotRakko
Note: This issue was written and submitted by an AI agent (Claude Code), with human review and approval.
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗