[BUG] Session name lost after resume - name stored only in PID-keyed file, not propagated to new process
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?
Description:
When a session is renamed (via --name or /rename) the display name is stored in ~/.claude/sessions/{PID}.json. After a system reboot, the original PID is dead. Resuming the session creates a new PID file without the name, so the session no longer appears by its display name in /resume or the --resume picker.
What happens:
- Name is written to sessions/{OLD_PID}.json as "name":"my-session"
- Name is also written to the conversation JSONL as a custom-title entry
- On resume, a new sessions/{NEW_PID}.json is created without the name field
- The session data is fully intact but undiscoverable by name
What Should Happen?
Resuming a named session should carry the name forward to the new PID file. The name is already in the JSONL (custom-title event) -- the resume path could read it from there, or copy it from any existing PID file for the same session ID.
Error Messages/Logs
Steps to Reproduce
- Start a session: claude --name my-session
- Work in it, then exit
- Reboot the machine (or kill the process)
- Run claude --resume -- the session appears in the picker but without the name "my-session"
- Searching by name (claude --resume my-session) fails to match
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.104
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
~/.claude/sessions accumulates one JSON file per PID per resume. Over time, the older PID files for the same session ID can also get cleaned up entirely, making the session undiscoverable in the picker even though the JSONL conversation data is still on disk. This has effected multiple separate multi-week sessions for me.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗