Resume shows only partial conversation history due to stale sessions-index.json
Status Fixed / completed
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 6 comments · opened Jan 30, 2026 · closed Aug 19, 2026
Description
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 --resumeand 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: 3and has incorrectfirstPrompt
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.jsonshould accurately reflect the conversation's message count and first prompt- Resume should restore the full conversation history as stored in the
.jsonlfile
Actual Behaviour
sessions-index.jsonmetadata 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
.jsonlfile 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.
Showing cached comments. Read the full discussion on GitHub ↗
5 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Those are about session's not showing up to resume. This is about messages/context missing from a resumed conversation.
Occurs on Arch Linux too
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.
Exact same issue here: https://github.com/anthropics/claude-code/issues/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:
<img width="1732" height="575" alt="Image" src="https://github.com/user-attachments/assets/42a7fd9a-502d-4e5b-8192-d1c51613287b" />
And then after fix:
<img width="1811" height="956" alt="Image" src="https://github.com/user-attachments/assets/6df5f562-ef11-4e0d-aead-e76f7f1c5e93" />
Same CC instance, same folder.