claude-code - 💡(How to fix) Fix [BUG] `claude -r` doesn't find sessions when ~/.claude/projects/ entries are symlinks [2 comments, 2 participants]

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…
GitHub stats
anthropics/claude-code#46342Fetched 2026-04-11 06:22:48
View on GitHub
Comments
2
Participants
2
Timeline
6
Reactions
0
Timeline (top)
labeled ×4commented ×2

Error Message

Error Messages/Logs

RAW_BUFFERClick to expand / collapse

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • I am using the latest version of Claude Code

What's Wrong?

I use GNU Stow to manage my dotfiles, which creates symlinks . .jsonl session files exist and are accessible through the symlink, but claude -r doesn't find them. Sessions in real (non-symlinked) directories in the same location work fine.

What Should Happen?

claude -r should follow symlinks when scanning for session files.

Error Messages/Logs

Steps to Reproduce

  1. Create a project directory under ~/.claude/projects/ with session .jsonl files
  2. Replace it with a symlink pointing to the same data (e.g., via ln -s /path/to/real/dir ~/.claude/projects/project-name)
  3. Run claude -r — the sessions from that project no longer appear

Claude Model

None

Is this a regression?

I don't know

Last Working Version

No response

Claude Code Version

2.1.100

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Other

Additional Information

No response

extent analysis

TL;DR

The issue can likely be resolved by modifying the claude -r command to follow symlinks when scanning for session files.

Guidance

  • Verify that the symlinks are correctly created and point to the expected locations using ls -l or readlink.
  • Check the documentation of claude -r to see if there are any options or flags that enable symlink following.
  • Test whether claude -r works when run from the actual directory containing the session files, rather than the symlinked directory.
  • Consider modifying the script or command that runs claude -r to use the actual directory path instead of the symlinked path.

Example

No code snippet is provided as the issue does not contain sufficient information about the implementation details of claude -r.

Notes

The issue may be related to the implementation of claude -r and its handling of symlinks. Without more information about the internal workings of claude -r, it is difficult to provide a more specific solution.

Recommendation

Apply workaround: Modify the script or command that runs claude -r to use the actual directory path instead of the symlinked path, as this is a more reliable and consistent approach.

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