--resume fails silently when cwd differs from session's original directory
Summary
claude --resume <session-id> fails with "session not found" when the current working directory doesn't match the directory the session was originally started in. Session lookup is scoped by project/directory, but the session ID is globally unique.
Steps to reproduce
- Start a Claude Code session in
/path/to/project-a - Suspend with Ctrl+Z
cd /path/to/project-bfgto resume Claude- Quit Claude (Ctrl+D or
/exit) - Claude prints:
Resume this session with: claude --resume <session-id> - Run that exact command - fails because your shell is now in
project-b
Expected behavior
Either:
--resumeshould search all projects for the session ID (it's a UUID, it's globally unique)- Or the exit message should include the directory:
cd /path/to/project-a && claude --resume <session-id>
Actual behavior
--resume silently fails with "session not found" despite the transcript existing on disk at ~/.claude/projects/-home-...-project-a/<session-id>.jsonl.
Why this is confusing
Claude Code itself prints the failing resume command at exit time. The user hasn't navigated away after quitting - they're running the command exactly as printed, in the same terminal, and it doesn't work. There's no hint that directory matters or which directory to use.
Environment
- Claude Code 2.1.177
- Linux (WSL2)
This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗