D:/Program Files/Git/resume picks session from wrong project directory (showAllProjects defaults to true)
Bug Description
/resume in Claude Code CLI resolves sessions from all projects by default instead of scoping to the current working directory's project. This causes "cross-contamination" where running /resume in Project A shows and auto-selects sessions from Project B.
Steps to Reproduce
- Work in Project A (e.g.,
D:\Dev\Projects\Lzhan) — creates sessions under~/.claude/projects/D--Dev-Projects-Lzhan/ - Switch to Project B (e.g.,
D:\Writing\...) — creates sessions there - Return to Project A directory
- Run
/resume - Expected: picker defaults to showing only Project A sessions
- Actual: picker shows ALL projects' sessions (
showAllProjectsdefaults totrue), and the most recent session from Project B appears first
Root Cause
In the ResumeCommand component (minified as jE_), the showAllProjects state defaults to true:
// Current (bug):
[O, D] = h4.useState(!0) // showAllProjects = true
// Expected (fix):
[O, D] = h4.useState(!1) // showAllProjects = false
The picker component (Js8) has proper project-scoped filtering logic — it just isn't activated by default because showAllProjects starts as true.
When showAllProjects is false, the picker correctly filters:
if (!O && D && AH) {
let u$ = i.length > 0 ? i : [KH];
m6 = m6.filter((w_) => {
let sK = w_.projectPath;
return u$.some((L$) => sK === L$ || sK.startsWith(L$ + sep));
});
}
Proposed Fix
Change the default value of showAllProjects in ResumeCommand from true to false. Users can still toggle to "show all projects" manually in the picker.
Environment
- Claude Code CLI v2.1.101
- Windows 11 Pro
- Multiple projects used in alternating sessions
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗