[BUG] /resume finds 0 sessions when git worktree exists in a submodule repository
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
/resume reports "No conversations found to resume" when a git worktree exists in a submodule repository. Session .jsonl files exist on disk (80+), but the session search finds 0 files.
Debug log shows the issue clearly:
[DEBUG] /resume: loading sessions for cwd=/Users/me/projects/parent-repo/app/my-project, worktrees=[/private/tmp/my-worktree, /Users/me/projects/parent-repo/.git/modules/app/my-project]
[DEBUG] /resume: found 0 session files on disk
Key observations:
- The project is a git submodule (
parent-repo/app/my-projectis a submodule ofparent-repo) - Git reports the main worktree path as
.git/modules/app/my-project(the submodule's git dir), which differs from the actual cwd - An additional worktree (
/private/tmp/my-worktree) was present sessions-index.jsondid not exist in the project directory
What Should Happen?
/resume should find and list all existing session files regardless of worktree or submodule state.
Specifically:
- The session file search should correctly resolve paths in git submodule environments, where the cwd and
git worktree listoutput differ - The presence of additional worktrees should not break session file discovery
Error Messages/Logs
/resume
No conversations found to resume.
Press Ctrl+C to exit and start a new conversation.
Steps to Reproduce
- Have a project that is a git submodule (e.g.,
parent-repo/app/my-projectas a submodule ofparent-repo) - Create a git worktree from the submodule (e.g.,
git worktree add /tmp/my-worktree) - Have existing Claude Code sessions (
.jsonlfiles exist in~/.claude/projects/<project>/) - Run
/resumein the submodule directory - Observe: "No conversations found to resume"
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.61 (also confirmed on 2.1.62)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
PyCharm terminal
Additional Information
Related but distinct issues:
- #28587 —
sessions-index.jsonstops updating (stale index) - #19995 —
/resumefails on Linux + npm install - #18311 —
cleanupPeriodDays: 0deletes.jsonlfiles - #28314 — Sessions in worktrees cannot resume after cleanup
- #28769 —
--resumeloses context with--worktree
This issue is specifically about the combination of git submodules and worktrees causing the session file search to fail entirely (found 0 session files on disk), even though the files are present. The suspected root cause is a path mismatch: the actual cwd differs from the worktree path that git reports for submodules.
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗