claude-code - 💡(How to fix) Fix /resume picker excludes sessions after moving them to a new project directory

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…

After moving a project's session .jsonl files into a new ~/.claude/projects/<encoded-cwd>/ directory (because the working directory was reorganized on disk), the affected sessions:

  • ✅ Appear in the Ctrl-A "all sessions" view in /resume
  • ✅ Resume successfully via claude --resume <session-uuid>
  • ❌ Are missing from the default project-scoped /resume picker for the new working directory

So the sessions are valid and indexed — only the current-project filter in the picker excludes them.

Root Cause

Restructuring local project locations is normal (consolidating worktrees, renaming directories, etc.). Today there is no documented way to keep /resume working after such a move, even though all the obvious on-disk state can be migrated by hand.

Fix Action

Workaround

claude --resume <uuid> works fine — the sessions themselves are intact. Users who reorganize their on-disk project layout currently need to know their session UUIDs to recover access to the picker entry. A documented "session migration" path, or a claude --reassign-session <uuid> --to <project-path> command, would close the gap.

RAW_BUFFERClick to expand / collapse

Title

/resume picker excludes sessions after moving them to a new project directory, even when all on-disk references are updated

Environment

  • Claude Code 2.1.139, macOS (Darwin 25.4.0, arm64)
  • Bun-compiled native binary at ~/.local/share/claude/versions/2.1.139

Summary

After moving a project's session .jsonl files into a new ~/.claude/projects/<encoded-cwd>/ directory (because the working directory was reorganized on disk), the affected sessions:

  • ✅ Appear in the Ctrl-A "all sessions" view in /resume
  • ✅ Resume successfully via claude --resume <session-uuid>
  • ❌ Are missing from the default project-scoped /resume picker for the new working directory

So the sessions are valid and indexed — only the current-project filter in the picker excludes them.

Repro

  1. Have an existing project directory, e.g. /Users/me/old/path with sessions in ~/.claude/projects/-Users-me-old-path/
  2. Move/rename the working directory on disk to a new location, e.g. /Users/me/new/path
  3. Move the session JSONLs into the new encoded directory: ~/.claude/projects/-Users-me-new-path/
  4. Update every path-keyed reference Claude Code stores:
    • All cwd fields inside each event line in the JSONLs (~thousands per file)
    • The project field for every entry in ~/.claude/history.jsonl
  5. cd /Users/me/new/path && claude, then run /resume

Expected: the migrated sessions appear in the picker for the new project. Actual: picker is empty for the new project. Ctrl-A still shows them. claude --resume <uuid> works.

What I audited and updated

  • ~/.claude/projects/-Users-me-new-path/<uuid>.jsonl — file location ✓
  • cwd field on every event in each JSONL (~3,000 events total) ✓
  • Trailing events where the user cd'd to home mid-session ✓
  • gitBranch field already matched current branch ✓
  • project field on 249 entries in ~/.claude/history.jsonl
  • ~/.claude.json projects dict — the new path is present, the old path is not
  • File permissions normalized to 0600
  • JSONL files still parse cleanly (verified via json.loads per line, zero malformed)

I also generated a sessions-index.json (since I noticed two such files in older project dirs), but strings on the binary returned zero matches for sessions-index / session-index / sessionIndex, so that file is unused by 2.1.x. (Those two existing index files are stale leftovers from January/February.)

Implications

There is some internal-to-Claude-Code mechanism that decides "this session belongs to project X" which is not any of:

  • The encoded project-directory name where the JSONL lives
  • The cwd field inside the events
  • The project field in ~/.claude/history.jsonl
  • A sidecar/index file on disk

Because all of those say "new path" and the picker still excludes the session.

Plausible candidates worth checking on the team's side:

  • A per-session field captured at session creation time that isn't updated when content is rewritten externally
  • A hash/fingerprint of the original cwd persisted somewhere
  • A check on file inode, btime, or some other filesystem attribute that changes when files are moved
  • An in-memory project→session map that's hydrated only from sessions created in-process during recent runs

Workaround

claude --resume <uuid> works fine — the sessions themselves are intact. Users who reorganize their on-disk project layout currently need to know their session UUIDs to recover access to the picker entry. A documented "session migration" path, or a claude --reassign-session <uuid> --to <project-path> command, would close the gap.

Why this matters

Restructuring local project locations is normal (consolidating worktrees, renaming directories, etc.). Today there is no documented way to keep /resume working after such a move, even though all the obvious on-disk state can be migrated by hand.

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