fix: follow symlinks when discovering project directories#30
Conversation
roborev: Combined Review (
|
os.ReadDir returns DirEntry where IsDir() is false for symlinks to directories. This caused DiscoverClaudeProjects and the Gemini discovery functions to silently skip symlinked project directories, making CLAUDE_PROJECTS_DIR unusable with symlinked repos. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
…ile parity isDirOrSymlink now stat-resolves symlink targets to confirm they point to directories, rejecting symlinks to files and broken links. FindClaudeSourceFile updated to use isDirOrSymlink instead of IsDir, matching DiscoverClaudeProjects behavior for symlinked project directories. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
528b1f2 to
0d6c74f
Compare
roborev: Combined Review (
|
… test The previous test had the real directory inside the search root, so FindClaudeSourceFile could find the session without traversing the symlink. Now the real directory is in a separate temp dir, only reachable via the symlink. Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
roborev: Combined Review (
|
|
pedantic. merging |
|
Great timing on this: we ran into this exact issue today while integrating agentsview into our project and were planning to open a PR for it. Thanks for the fix! |
Symlinked project directories under
CLAUDE_PROJECTS_DIRwere silently skipped, making it impossible to scan a subset of projects by symlinking selected project directories into a custom directory.Summary
os.ReadDirreturnsDirEntrywhereIsDir()isfalsefor symlinks to directories, causingDiscoverClaudeProjectsand Gemini discovery to silently skip symlinked project directoriesisDirOrSymlink()helper that also checksModeSymlink, applied to all three affected call sites (Claude projects, Gemini session discovery, Gemini source file lookup)Test plan
/tmp/filtered-projects/containing a symlink to one project: before fix discovers 0 claude files, after fix discovers 4🤖 Generated with Claude Code