[BUG] /resume finds 0 sessions when git worktree exists in a submodule repository

Resolved 💬 5 comments Opened Feb 27, 2026 by tomouchi Closed Mar 30, 2026

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-project is a submodule of parent-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.json did 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 list output 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

  1. Have a project that is a git submodule (e.g., parent-repo/app/my-project as a submodule of parent-repo)
  2. Create a git worktree from the submodule (e.g., git worktree add /tmp/my-worktree)
  3. Have existing Claude Code sessions (.jsonl files exist in ~/.claude/projects/<project>/)
  4. Run /resume in the submodule directory
  5. 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.json stops updating (stale index)
  • #19995 — /resume fails on Linux + npm install
  • #18311 — cleanupPeriodDays: 0 deletes .jsonl files
  • #28314 — Sessions in worktrees cannot resume after cleanup
  • #28769 — --resume loses 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.

View original on GitHub ↗

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