Glob tool does not follow symlinks (unlike shell glob expansion)
Description
The Glob tool does not follow symbolic links when expanding patterns, unlike standard shell glob expansion (bash/zsh). This means any directory structure using symlinks is invisible to Glob and Grep, forcing users to fall back to Bash(ls ...) or Bash(find -L ...).
Reproduction
Given this directory structure:
data/
├── items/foo/ # canonical directory (real files)
│ ├── README.md
│ ├── docs/report.md
│ └── ...
└── categories/bar/
└── foo -> ../../items/foo # symlink
Glob tool — returns nothing:
Glob(pattern: "data/categories/bar/foo/**/*.md")
→ No files found
Bash with same glob — returns 26 files:
Bash(ls data/categories/bar/foo/**/*.md)
→ data/categories/bar/foo/README.md
→ data/categories/bar/foo/docs/report.md
→ ... (26 files)
Same pattern, same path, different results. Shell glob expansion follows symlinks by default; the Glob tool does not.
Impact
- Any project using symlinks for directory organization has broken Glob/Grep search
- The Grep tool has the same issue since it also doesn't traverse symlinks
- Claude falls back to Bash for file discovery, defeating the purpose of having dedicated tools
Readfollows symlinks fine — only Glob and Grep are affected
Expected behavior
Glob should follow symlinks by default, matching the behavior of shell glob expansion (bash, zsh, and most glob libraries).
Likely root cause
If the Glob tool uses fast-glob under the hood, the default is followSymbolicLinks: false. Setting it to true would fix this.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗