/resume picker silently switches to global view when current dir's session bucket is empty and git ancestor exists

Resolved 💬 3 comments Opened May 20, 2026 by AlexisLaporte Closed May 23, 2026

Summary

When claude --resume (or /resume) is launched from a directory whose own session bucket (~/.claude/projects/-<encoded-path>/) contains 0 .jsonl files, the picker silently falls back to a cross-project view scoped by the git toplevel ancestor, instead of either (a) showing 0 sessions, or (b) the literal current-dir bucket. The fallback is undocumented; there is no UI indication of the scope change.

This is particularly painful for meta-project setups where a parent git repo aggregates multiple sub-mission directories.

Repro

mkdir -p /tmp/repro && cd /tmp/repro
git init                                 # makes /tmp/repro a git repo

# Sub-mission A: has its own session history bucket
mkdir A && cd A && claude  # exit immediately after first prompt, creates one session
cd ..

# Sub-mission B: no .git of its own
mkdir B && cd B
claude --resume
# /resume picker shows sessions from BOTH A and B (and any other subdir
# of /tmp/repro that has ever been claude'd), capped at ~50 globally.

Equivalent behavior in production: I have a meta-repo at /data/ark/ which versions <mission>/CLAUDE.md for ~10 sub-missions. Each sub-mission has its own session bucket (~/.claude/projects/-data-ark-<mission>/). The bucket for /data/ark/ itself has only a memory/ folder, 0 .jsonl. Launching claude from any /data/ark/<mission>/ (no local .git) makes the picker scope to -data-ark-* collectively — 48 sessions across all missions instead of just the current one.

Expected

The picker default scope should be the literal launch directory's bucket, period. If empty, show "0 sessions in this project" with a hint that Ctrl+A opens the global view. Don't silently expand scope based on git ancestry.

Alternative: an explicit setting or env var (CLAUDE_CODE_RESUME_SCOPE=cwd|git|all) so users can opt into the current behavior if they actually want git-rooted scope.

Actual

Picker shows up to ~50 sessions from across all projects whose path is a child of the git toplevel. Status bar shows 1 of 48 with no indication of why scope expanded.

Workaround

Move the parent .git outside the git ancestor of sub-missions:

mv /data/ark/.git /data/ark-repo/.git
git -C /data/ark-repo config core.worktree /data/ark
alias arkgit='git -C /data/ark-repo'

This is heavy-handed (breaks cd /data/ark && git status ergonomics) and shouldn't be necessary.

Environment

  • Claude Code 2.1.145, Linux Mint / Ubuntu 26
  • Tested confirmed via temporarily renaming /data/ark/.git → picker scoped correctly to launch dir
  • Tested confirmed: launching from /data/test-resume (no git ancestor) scopes correctly

Refs

  • Related but distinct: #46445 (initial 2.1.101 regression, fixed in 2.1.108)
  • Related: #46522 (picker hides sessions after rename/move)
  • Opposite request: #60573 (feature: cross-project resume)

View original on GitHub ↗

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