[BUG] /resume finds no sessions when ~/.claude/projects/<slug> is a symlink/junction and the repo has 2+ git worktrees

Status Open
Reported on v2.1.281
Maintainer reply None cached
Activity 1 comment · opened Sep 24, 2026

Environment

  • Claude Code 2.1.281 (native install). The same loader logic is also in 2.1.280.
  • Windows 11 Pro 10.0.26200. The code path is platform-independent, so macOS is probably affected too.

What happens

~/.claude/projects/<slug> is a directory junction (a symlink on macOS) to a folder elsewhere, used to sync
transcripts between machines. Inside the repo, /resume shows "No conversations found in this project"
as soon as the repo has more than one git worktree. Resuming by id (claude --resume <id>) still works.

With --debug-file:

/resume: loading sessions for cwd=C:\...\MyRepo, worktrees=[C:/.../MyRepo, C:/.../MyRepo/.claude/worktrees/agent-a..., C:/.../MyRepo/.claude/worktrees/agent-b...]
/resume: found 0 session files on disk

Observed

  • The repo's project dir had been a junction since the morning, and /resume listed and resumed its sessions

several times that day.

  • Later that evening, subagents with worktree isolation left 2 worktrees in .claude/worktrees/agent-*.
  • The next day /resume in the repo found 0 sessions (log above).
  • On the same machine, another repo with a junctioned project dir and a single worktree still lists its

sessions normally.

Steps to reproduce (derived from the case above and the loader code)

  1. Replace ~/.claude/projects/<slug-of-MyRepo> with a junction/symlink to a folder holding at least one

session.

  1. With a single worktree, /resume lists the sessions: that path reads projects/<slug> directly and

follows the link.

  1. git worktree add ../MyRepo-wt.
  2. /resume now finds 0 session files.

Likely cause

With more than one worktree, the loader enumerates the projects dir and keeps only
readdir(projectsDir, { withFileTypes: true }).filter(d => d.isDirectory()). Dirent.isDirectory() is false
for symlinks and junctions. The current project is pushed directly only when the cwd does not match a
registered worktree path; the main worktree always matches. So the linked project dir is dropped and 0 session
files are found.

Expected

Symlinked/junctioned project dirs are listed the same way in both paths. For example, accept
d.isSymbolicLink() entries whose fs.stat() target is a directory.

Related

  • #96511: /stats skips symlinked project dirs (same isDirectory() filter).
  • #51488: claude -r stopped following symlinks in ~/.claude/projects (2.1.104, closed as duplicate).
  • Also in the same debug log: tool-results path refused: ...\projects\<slug> is a link. Large tool/hook

outputs are not persisted when the project dir is a link.

View original on GitHub ↗

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