/resume project-scoped picker merges whole session dirs of unrelated projects into discovery (2.1.220)

Status Open
Reported on v2.1.220
Maintainer reply None cached
Activity 1 comment · opened Jul 27, 2026

Environment

  • Claude Code 2.1.220 (native binary), macOS (Darwin 27.0.0, arm64)
  • Multiple independent Laravel projects under ~/Development, each its own git repo with its own GitHub remote (no shared history, no shared remotes, no cross-repo worktrees)

Expected

The default /resume / claude --resume picker view (before pressing Ctrl+A) shows only sessions for the current project and its git worktrees, per the documented behavior.

Actual

The default project-scoped view merges in whole session directories of unrelated projects. Confirmed with -d debug output; the numbers are exact:

Project A (call it project-a, 208 own session files):

[DEBUG] /resume: loading sessions for cwd=/Users/me/Development/project-a, worktrees=[/Users/me/Development/project-a]
[DEBUG] /resume: found 534 session files on disk

534 = 208 (project-a) + 326 (project-b, an unrelated repo). Sessions from project-b appear in project-a's default picker list with their custom titles.

Project C (980 own files) shows found 1353 = 980 (own) + 326 (project-b again) + 47 (a claude.ai/code clone dir under ~/.polyscope/clones/... for a different repo bucket).

Project B itself shows found 1351, which includes project-c's 980 files, so B and C are mutually merged.

A fourth project on the same machine is clean: found 311 = 188 own + 123 from its real registered .claude/worktrees checkout, exactly as documented. So this is not "show all projects"; specific directories are being cross-attributed.

What I ruled out

  • On-disk stores are consistent: every ~/.claude/projects/<dir>/*.jsonl records a cwd matching its directory; no misfiled files
  • The worktrees=[...] list in the debug line is correct in all cases (the foreign dirs are NOT in it, yet their files are counted and shown)
  • githubRepoPaths in ~/.claude.json maps each repo only to its own path
  • No shared git remotes, no shared root commits, no git worktree registrations across the affected repos, no objects/info/alternates
  • No sanitized-path collisions between the affected directory names
  • One data point that may be relevant: the most recent session in project-b's store contains messages recorded with cwd inside project-c (the session cd'd there mid-session), which would explain the B and C mutual merge if per-message cwd is used for directory attribution. It does not explain project-a pulling in project-b (zero cross-cwd occurrences in either direction there).

Impact

Session titles from other client projects are shown in the project-scoped picker (confidentiality concern for consultants), and the picker is noisy. Ctrl+A widens further; Ctrl+B / search are the only mitigations.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗