/resume shows empty session list in git worktree directories
Description
/resume shows an empty session list when Claude Code is launched from a git worktree directory, even though session JSONL files exist and were correctly written during previous sessions.
Environment
- Claude Code v2.1.92
- macOS (Darwin 25.4.0)
- zsh
Setup
Main repo: ~/projects/main-repo
Worktree: ~/projects/worktree-dir (created via git worktree add)
$ git rev-parse --git-dir
~/projects/main-repo/.git/worktrees/worktree-dir
What happens
- Run
claudefrom~/projects/worktree-dir— works fine, session is created - Session JSONL is saved to
~/.claude/projects/-projects-worktree-dir/— correct - Exit Claude Code
- Run
claudeagain from the same directory /resume→ shows empty list, immediately "Resume cancelled"
Expected
/resume should list sessions from ~/.claude/projects/-projects-worktree-dir/
Root cause hypothesis
/resume resolves project path via git root (which points to the main repo through .git/worktrees/), not via cwd. So it looks for sessions in the main repo's project directory instead of the worktree's project directory.
Evidence: the main repo directory has ~30 session files and /resume works there. The worktree directory has 4 session files but /resume never finds them.
Workaround
claude --resume <session-id> with explicit session ID works.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗