Glob tool does not follow symbolic links
Summary
The Glob tool does not traverse symbolic links to directories. When a symlink points to a directory containing files, patterns like symlink/* or symlink/**/* return "No files found".
Reproduction Steps
- Create a directory with files:
``bash``
mkdir -p /tmp/test-dir
echo "test" > /tmp/test-dir/file.txt
- Create a symlink in your project:
``bash``
ln -sf /tmp/test-dir symlink
- Try to glob through the symlink:
Glob pattern: symlink/*→ No files foundGlob pattern: symlink/*.txt→ No files foundGlob pattern: symlink(the symlink itself) → No files found
- Compare with direct path:
Glob pattern: * in /tmp/test-dir→ Finds file.txt ✓
- Compare with Read tool:
Read: <project>/symlink/file.txt→ Works correctly ✓
Expected Behavior
Glob should follow symlinks by default (similar to find -L, standard glob libraries, or ripgrep's default behavior), or provide an option to enable symlink following.
Actual Behavior
- Glob ignores symlinked directories entirely
- Cannot match files inside symlinked directories
- Cannot even match the symlink name itself as a pattern
Use Case
In GitHub Actions workflows (e.g., claude-code-action), we create symlinks to temp directories containing contextual data (JIRA tickets, Confluence pages). The CLAUDE.md instructions reference these symlinked paths with glob patterns, which fail silently:
# In GitHub Actions workflow
- name: Create guideline symlinks
run: |
ln -sf "$RUNNER_TEMP/atlassian" 'atlassian'
<!-- In CLAUDE.md -->
Check if "atlassian" directory exists. If so, read atlassian/*.xml files...
This pattern works for the Read tool but fails for Glob, creating an inconsistency between tools.
Suggested Solution
Either:
- Follow symlinks by default (most intuitive, matches other tools)
- Add a
followSymlinks: trueparameter to the Glob tool - Document the limitation clearly
Environment
- Claude Code CLI (latest via npm)
- Linux (Ubuntu)
- Also likely affects macOS
This issue has 8 comments on GitHub. Read the full discussion on GitHub ↗