Session becomes inaccessible via --resume / desktop UI despite intact .jsonl transcript (stale session index after directory path change)

Open 💬 1 comment Opened Jul 4, 2026 by Schmed

This report was drafted by Claude Code (AI assistant) based on debugging done during my session, and filed on my behalf with my review/approval.

---

Over several sessions working in a project directory, I had three prior Claude Code sessions become inaccessible — they didn't show up as resumable via --resume, nor could I reopen them through the desktop app's session picker.

I confirmed this is not data loss: the raw .jsonl transcript files for each of the affected sessions still exist on disk, fully intact, under ~/.claude/projects/<project-slug>/, with normal size and content matching the work actually done.

Suspected cause: the project's working directory was originally accessed via a symlinked path, then later accessed via the real resolved path (or vice versa). Claude Code appears to key its session index off of process.cwd()/getcwd()-style resolution (which always resolves through symlinks to the physical path), while at some point the session may have been recorded or looked up under the logical/symlinked path instead. The two path forms don't match in the session index, so lookups by --resume (and the desktop app's picker) fail to find sessions that are demonstrably present in ~/.claude/projects/.

I ruled out other causes I could think of (e.g., permissions, corruption, project-slug hashing changes unrelated to symlinks) — the .jsonl files decode fine and match expected content; only session discovery seems to be broken.

Impact: Users working through very long sessions (e.g., an all-day multi-issue session) can lose the ability to resume or browse a session's history through normal means, even though nothing was actually lost, which is confusing and makes it look like data loss when it isn't.

Environment: macOS (Darwin 25.3.0), Claude Code CLI, project directory previously accessed via a symlink that was later resolved to its real path (or the reverse ordering).

View original on GitHub ↗

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