You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
Resume shows only partial conversation history due to stale sessions-index.json #22030
When using --resume to resume a conversation, only a few recent messages appear instead of the full conversation history. The conversation data file contains the complete history, but sessions-index.json has incorrect/stale metadata.
Steps to Reproduce
Have a long conversation with many messages
Exit the session
Resume with claude --resume and select the conversation
Only the last few messages appear, earlier conversation history is missing
Investigation Findings
Examined the conversation files in ~/.claude/projects/<project>/:
Conversation file (*.jsonl): Contains 1480 lines with 678 user messages and 741 assistant messages
sessions-index.json: Shows messageCount: 3 and has incorrect firstPrompt
Example discrepancy:
Actual first message: "i want to run a detailed security review on this code base..."
sessions-index.json firstPrompt: "i want you to create a html file that look like a ppt..."
The firstPrompt in the index corresponds to a message from much later in the conversation, and messageCount is drastically underreported.
Expected Behaviour
sessions-index.json should accurately reflect the conversation's message count and first prompt
Resume should restore the full conversation history as stored in the .jsonl file
Actual Behaviour
sessions-index.json metadata becomes stale/out of sync with actual conversation file
Resume uses the incorrect index metadata, showing only partial history
Full conversation data IS preserved in the .jsonl file but not loaded
Environment
macOS (Darwin 24.6.0)
Issue occurred on multiple separate conversations
Workaround
The conversation data is intact. Deleting sessions-index.json may force a rebuild, though this hasn't been tested.
Reacted by surfvani, Peter-Petersburg, tamasarpad, kadirtugarantibbva, Vitor Viana, Lars, XieRan.sai, aruma256, farewingg, Alexei Strasser and 4 more
Thanks for the detailed investigation — the mechanism you identified was real at the time, but it has since been removed.
What I tried on 2.1.233 (Linux): recreated your setup — a project with a long conversation .jsonl plus a stale sessions-index.json claiming messageCount: 3 and a wrong firstPrompt — then ran claude --resume. The full conversation history was restored (verified with /export); the stale index file is ignored entirely.
The per-project sessions-index.json cache was replaced in 2.1.30 ("replacing the session index with lightweight stat-based loading and progressive enrichment" — see the changelog), and later releases (2.1.77, 2.1.91, 2.1.108) fixed remaining cases of --resume truncating history. Any leftover sessions-index.json on disk is now inert and safe to delete.
Note that after resuming, the screen only renders the most recent messages — earlier history is still loaded (Ctrl+O shows the full transcript).
Closing as fixed — reply here if you still see partial history on a current version and we'll reopen.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.
Activity
github-actions commentedon Jan 30, 2026
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
tamasarpad commentedon Feb 1, 2026
Those are about session's not showing up to resume. This is about messages/context missing from a resumed conversation.
shovel-kun commentedon Feb 1, 2026
Occurs on Arch Linux too
qubitcontracting commentedon Feb 3, 2026
Quick check to verify you have this bug:
Linux/macOS/WSL:
Windows PowerShell:
If Index is much lower than Actual, you have this bug.
Confirming across 4 machines (all v2.1.29):
Workaround: Create a SessionEnd hook that updates
sessions-index.jsonon exit.The fix needs to:
.jsonlsession file in each projectsessions-index.jsonwith:messageCount= line count of the session filefileMtime= file modification time in milliseconds since epochmodified= current UTC timestamp in ISO formatYou can ask Claude Code to generate this fix for your OS by describing the above requirements.
ByTheSeaL commentedon Feb 4, 2026
Exact same issue here: #22960
Solved by deleting sessions-index.json. downgrading to 2.1..29 and relaunching with "claude /resume". I'll implement the SessionEnd hook next.
Screenshot of /resume page with bug:
And then after fix:
Same CC instance, same folder.
bcherny commentedon Aug 19, 2026
Thanks for the detailed investigation — the mechanism you identified was real at the time, but it has since been removed.
What I tried on 2.1.233 (Linux): recreated your setup — a project with a long conversation
.jsonlplus a stalesessions-index.jsonclaimingmessageCount: 3and a wrongfirstPrompt— then ranclaude --resume. The full conversation history was restored (verified with/export); the stale index file is ignored entirely.The per-project
sessions-index.jsoncache was replaced in 2.1.30 ("replacing the session index with lightweight stat-based loading and progressive enrichment" — see the changelog), and later releases (2.1.77, 2.1.91, 2.1.108) fixed remaining cases of--resumetruncating history. Any leftoversessions-index.jsonon disk is now inert and safe to delete.Note that after resuming, the screen only renders the most recent messages — earlier history is still loaded (Ctrl+O shows the full transcript).
Closing as fixed — reply here if you still see partial history on a current version and we'll reopen.
🤖 Generated with Claude Code
github-actions commentedon Oct 9, 2026
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.