Session name, color, and index are lost after system reboot — --resume becomes unusable

Resolved 💬 3 comments Opened Mar 26, 2026 by handpower Closed Mar 29, 2026

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

  1. Start a session: claude
  2. Name it: /rename mySession
  3. Set color: /color blue
  4. Exit: /exit
  5. Verify: claude --resume "mySession" — works, name and color intact
  6. Reboot the machine
  7. Try again: claude --resume "mySession" — fails, session not found

Workaround

It's possible to recover the session by:

  1. Manually finding the correct JSONL file in ~/.claude/projects/
  2. 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)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗