claude-code - 💡(How to fix) Fix /resume picker silently switches to global view when current dir's session bucket is empty and git ancestor exists

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

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.

Root Cause

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.

Fix Action

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.

Code Example

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.

---

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'
RAW_BUFFERClick to expand / collapse

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)

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING