Resume picker hides sessions whose cwd drifted into a subdirectory repo mid-session; ctrl+a hint invisible while searching

Open 💬 0 comments Opened Jul 6, 2026 by shallow-alchemy

Summary

The /resume / claude --resume picker scopes sessions by their last recorded cwd, not by where the session was started or where its transcript is stored. A session that starts in directory A and later cds (or is relocated by EnterWorktree) into a git repo underneath A gets re-bucketed under that repo — and silently disappears from the picker when opened from A, even though its transcript .jsonl lives under A's own ~/.claude/projects/<A>/ folder.

Related to #65945 (picker is cwd-scoped), but this is a sharper variant: the user started the session in the current directory, so "go back to where you started it" is not an obvious fix — from their point of view the session vanished from the place it has always lived.

Repro (observed on 2.1.201, macOS)

  1. In ~/Development (not itself a git repo), start a session and rename it (/rename my-session).
  2. During the session, cd into ~/Development/some-repo (a git repo) — e.g. a build loop working inside a repo/worktree. End the session while cwd is inside the repo.
  3. From ~/Development, run claude --resume and search for my-session.

Expected: the session appears — it was started here and its transcript is stored under this directory's project folder.

Actual: no match. The transcript is intact at ~/.claude/projects/-…-Development/<session-id>.jsonl with a valid trailing custom-title record; the session's dominant/final cwd records point at ~/Development/some-repo. Resuming directly by ID (claude --resume <uuid>) works fine, and the session does appear when the picker is opened from inside some-repo.

Discoverability compounding factor

The picker does have an escape hatch — ctrl+a "show all projects" — but its hint is only rendered when the search box is empty. The moment the user types the name of the session they're hunting for (the exact situation where they need the toggle), the hint disappears. Suggest showing the hint (or an "N sessions hidden by repo filter — ctrl+a to show all" notice) whenever a search returns zero/few results.

Suggested behavior

Any of these would resolve the surprise:

  • Bucket sessions by starting cwd (or by the project folder the transcript is stored under) rather than last cwd; or
  • Match sessions whose cwd is a descendant of the current directory when the current directory is not itself a repo; or
  • At minimum, surface the repo-filter state + ctrl+a hint when a search comes up empty.

Environment

  • Claude Code 2.1.201, macOS (darwin 25.5.0)
  • Session in question used /loop + EnterWorktree-based builds, ending with cwd inside a child repo

🤖 Generated with Claude Code

https://claude.ai/code/session_01N7L1VvohTz6y2Q8nEGGMnW

View original on GitHub ↗