--resume fails silently when cwd differs from session's original directory

Resolved 💬 2 comments Opened Jun 15, 2026 by vlasky Closed Jun 15, 2026

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

  1. Start a Claude Code session in /path/to/project-a
  2. Suspend with Ctrl+Z
  3. cd /path/to/project-b
  4. fg to resume Claude
  5. Quit Claude (Ctrl+D or /exit)
  6. Claude prints: Resume this session with: claude --resume <session-id>
  7. Run that exact command - fails because your shell is now in project-b

Expected behavior

Either:

  • --resume should 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)

View original on GitHub ↗

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