Slash-clear creates sessions invisible to slash-resume picker due to malformed file structure
Description
Sessions created after /clear are not shown in the /resume picker, even if they have been /renamed. However, they can be successfully resumed via claude --resume <session_id>.
Root Cause
When /clear is used, the resulting session .jsonl file starts with type: progress records instead of the expected type: init or type: summary record. The /resume picker appears to rely on the initial file structure to identify valid sessions, so it skips these files.
Example of a normal session file start:
{"type":"init", ...}
{"type":"summary", "title":"...", ...}
{"type":"user", ...}
Example of a post-/clear session file start:
{"type":"progress", "parentUuid":null, "isSidechain":false, ...} ← not expected
{"type":"progress", "parentUuid":null, "isSidechain":false, ...} ← not expected
{"type":"file-history-snapshot", ...}
{"type":"user", ...}
The custom-title record (from /rename) exists deep in the file (e.g., line 264), but the picker never reaches it because it skips the session early.
Steps to Reproduce
- Start a Claude Code session and do some work
- Run
/renameto name the session (e.g., "Session A") - Run
/clearto start fresh within the same process - Do some more work in the new session
- Run
/renameto name the new session (e.g., "Session B") - Exit and run
/resume— "Session B" does not appear in the list - Run
claude --resume <session-B-id>— works fine
Expected Behavior
All /renamed sessions should appear in the /resume picker, regardless of how they were created.
Workaround
Use claude --resume <session_id> directly instead of the /resume picker. The session ID can be found by searching the .jsonl files in ~/.claude/projects/.
Environment
- Claude Code version: latest (2026-03-27)
- OS: Windows 11 Pro
- Shell: bash
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗