[BUG] [Root Cause Analysis Included] Session Resume didn't load full history
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?
When resuming a session, in certain cases an incomplete session is resumed and sent to API instead of the full session.
This is caused by the jsonl message loader and the message chain walker.
jsonl message loader filters out message types of bash_progress etc due to they are useless.
message chain walker tries to walk the main message chain by parent uuid.
When walker walks to the message whose parent uuid belongs to the bash_progress, it stops and returns.
This causes an incomplete session resumption.
What Should Happen?
During a session resumption, when auto compaction is disabled, full history should be loaded and sent to API.
Error Messages/Logs
Steps to Reproduce
- send a few messages
- uses the bash tool that writes progress to the command line. for example, converting docx to pdf through docx2pdf python library
- send a few other messages
- close CC
- resume session
- ask for the first message
- it will only remember the first message after bash call
Claude Model
Not sure / Multiple models
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
2.1.74
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
The patch I created and used in my UI app can be found here.
https://github.com/wellofspirit/ClaudeUI/tree/main/patch/incomplete-session-resume-fix
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗