Session name, color, and index are lost after system reboot — --resume becomes unusable
Problem
After a system reboot, claude --resume "mySession" fails because the session index (~/.claude/sessions/) is cleared. The conversation history (JSONL files in ~/.claude/projects/) survives, but the metadata needed to find and resume sessions is lost.
What's lost on reboot
| Data | Stored in | Survives reboot? |
|------|-----------|-----------------|
| Conversation history | ~/.claude/projects/<cwd>/<sessionId>.jsonl | ✅ Yes |
| Session index (pid → sessionId → cwd) | ~/.claude/sessions/<pid>.json | ❌ No |
| Session name (/rename) | ~/.claude/sessions/ (internal) | ❌ No |
| Session color (/color) | ~/.claude/sessions/ (internal) | ❌ No |
Steps to reproduce
- Start a session:
claude - Name it:
/rename mySession - Set color:
/color blue - Exit:
/exit - Verify:
claude --resume "mySession"— works, name and color intact - Reboot the machine
- Try again:
claude --resume "mySession"— fails, session not found
Workaround
It's possible to recover the session by:
- Manually finding the correct JSONL file in
~/.claude/projects/ - Using
claude --resume <uuid>with the JSONL filename
However, this only restores the conversation context — the session name and color are still lost.
Proposal
Persist session metadata (name, color, and the name-to-sessionId mapping) to a durable location that survives reboots. The JSONL file already records /rename commands, so one approach would be to read them back when resolving --resume by name.
Alternatively, store session metadata alongside the JSONL files in ~/.claude/projects/ rather than in the ephemeral ~/.claude/sessions/ directory.
Environment
- Claude Code 2.1.84
- macOS (Darwin 24.6.0)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗