/resume fails with 'No conversations found' on Windows when multiple git worktrees exist (case-sensitive path comparison)
What's Wrong?
/resume reports "No conversations found to resume" even though conversation .jsonl files exist on disk and are being written correctly. This happens on Windows when the git repository has 2 or more worktrees.
After reverse-engineering the native binary (v2.1.38), I identified the exact root cause in the lsI function:
When there are 2+ git worktrees, the code takes a branch that reads the ~/.claude/projects/ directory and does a case-sensitive string comparison (M === V / === operator) between the actual folder name on disk and the folder name generated from the current working directory path via kR().
On Windows (NTFS), the filesystem is case-insensitive, so a project folder may have been created with a different casing than what the current path produces (e.g., My-Project on disk vs My-project from kR()). The === comparison fails, no sessions are matched, and /resume shows "No conversations found."
When there is only 1 worktree (or none), the code takes a different branch that uses path.join() to construct the folder path directly, which works fine on Windows because the filesystem resolves it case-insensitively.
What Should Happen?
/resume should list all previous conversations for the current project, regardless of the casing of the project folder name in ~/.claude/projects/. The folder name comparison in lsI should be case-insensitive on Windows.
Steps to Reproduce
- On Windows, initialize a git repository in a directory with a mixed-case name (e.g.,
C:\Code\MyProject) - Start Claude Code and have at least one conversation (this creates a project folder in
~/.claude/projects/) - Note the exact casing of the folder created in
~/.claude/projects/(e.g.,C--Code-Myproject) - Create a second git worktree:
git worktree add ../some-branch some-branch - Run
/resume— it will report "No conversations found to resume" - Remove the extra worktree with
git worktree remove some-branch—/resumeworks again
Root cause in code (extracted from the native binary):
// kR - converts path to folder name (preserves original case)
function kR(H) {
return H.replace(/[^a-zA-Z0-9]/g, "-")
}
// lsI - lists sessions for resume
function lsI(H, $) {
let A = OH(), L = uh() // fs module, projects directory path
// Branch 1: single or no worktree — works fine (uses path.join, filesystem resolves case)
if (H.length <= 1) {
let f = CL(), E = KX(f)
return qQH(E, void 0, f)
}
// Branch 2: multiple worktrees — BUG IS HERE
let D = H.map((f) => kR(f)), I = []
let f = A.readdirSync(L)
for (let E of f) {
if (!E.isDirectory()) continue
let M = E.name // actual folder name on disk
for (let _ = 0; _ < D.length; _++) {
let V = D[_] // generated folder name from path
if (M === V || M.startsWith(V + "-")) { // <-- case-sensitive comparison!
I.push(...qQH(X3.join(L, M), void 0, H[_]))
break
}
}
}
return R$H(I)
}
Suggested fix:
// Case-insensitive comparison on Windows
const eq = process.platform === 'win32'
? (a, b) => a.toLowerCase() === b.toLowerCase()
: (a, b) => a === b
if (eq(M, V) || (process.platform === 'win32' ? M.toLowerCase().startsWith(V.toLowerCase() + "-") : M.startsWith(V + "-"))) {
Environment
- OS: Windows 11
- Claude Code version: 2.1.38 (native binary, installed via
irm https://claude.ai/install.ps1 | iex) - Shell: PowerShell / Git Bash
Related Issues
- #19995 — same symptom ("No conversations found"), reported on Linux
- #23614 — similar symptom on macOS, attributed to
sessions-index.json(which the native binary does not use — it reads.jsonlfiles directly)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗