/resume can't find sessions started in a different directory (picker is cwd-scoped)
Summary
/resume (both the interactive picker and /resume <session-id>) only surfaces sessions whose working directory matches the current one. Sessions started from a different directory are reported as "Session not found" or simply don't appear in the picker — even though their transcript .jsonl files are fully intact on disk under ~/.claude/projects/.
Nothing is actually lost; it's purely a discoverability gap in how the picker scopes results.
Steps to reproduce
- Start a session in directory A (e.g.
~/projects/foo). Note its session ID. cdto a different directory B (e.g.~/projects/bar).- Run
claudeand/resume <session-id-from-A>.
Expected: the session resumes (or is at least offered).
Actual: Session not found. The same session is also missing from the interactive /resume picker while in directory B.
Confirm the transcript exists the whole time:
SESSION_ID=<id-from-A>
find ~/.claude/projects -name "*.jsonl" | xargs grep -l "$SESSION_ID"
Why this is surprising
The transcript records the originating directory in a cwd field on its first line:
head -1 path/to/session.jsonl | python3 -c "import sys,json; print(json.load(sys.stdin).get('cwd',''))"
So the information needed to find and correctly relaunch the session already exists — it just isn't used by the picker.
Suggested fix
- When an explicit
/resume <id>isn't found in the current scope, fall back to searching all of~/.claude/projects/before reporting "Session not found". - Optionally let the picker list (or offer a "search everywhere" toggle for) sessions across directories, decoding each session's real
cwdfrom the transcript'scwdfield rather than from the directory-name encoding (the-→/heuristic is ambiguous for paths containing hyphens). - On resume, restore the original
cwdso the session continues in the right place.
Workaround
I ended up writing a small plugin (recover-session) that scans ~/.claude/projects/, decodes the cwd field, summarizes the transcript, and relaunches in the original directory — but this really feels like it should be built into /resume.
Environment
- Claude Code CLI on macOS (darwin)
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗