Glob tool silently returns empty for anchored patterns (non-globstar first segment) on Windows
Summary
On Windows, the Glob tool returns an empty result ("No files found", no error) for any pattern whose first path segment is a literal name or a single * followed by /. Only **/-leading patterns and slash-free basename patterns match. The tool's own documented example src/**/*.ts falls in the failing class. Because it fails silently, it produces false negatives in discovery and automation.
Environment
- Claude Code (latest channel), Windows 11 (win32), Windows PowerShell 5.1
- Reproduced on both a local NTFS drive (
C:) and a mapped network drive (Z:, Synology SMB) — not filesystem-specific.
Reproduction
Skills directory laid out as <skills>/<name>/SKILL.md:
| pattern | path | result |
|---|---|---|
| **/SKILL.md | C:\Users\<user>\.claude\skills | ✅ 13 files |
| */SKILL.md | C:\Users\<user>\.claude\skills | ❌ "No files found" |
Same shape on a mapped network drive (files confirmed to exist):
| pattern | path | result |
|---|---|---|
| **/progress.json | Z:\projects\cortex | ✅ 3 files |
| projects/**/progress.json | Z:\projects\cortex | ❌ "No files found" |
| */meta/progress.json | Z:\projects\cortex\projects | ❌ "No files found" |
| vincent/meta/progress.json | Z:\projects\cortex\projects | ❌ "No files found" |
Cross-check (rules out the filesystem)
ripgrep (the Grep tool, including --glob) and PowerShell Get-ChildItem -Recurse both find the files correctly from the same base directories. So the Glob matcher is at fault, not the filesystem or the mount.
Expected
Anchored relative patterns (dir/**/file, */sub/file, a/b/c) match per standard glob semantics, relative to the path parameter.
Actual
Silent empty result ("No files found"), with no error or warning.
Impact
Silent false negatives. Agents and automation conclude "not found" when the files exist — with no error signal to catch it. The discriminating rule is: pattern contains / AND its first segment is not ** → silently empty.
Workaround
Use a **/-leading pattern (e.g. **/file.ext) or a slash-free basename, and scope with the tool's path parameter instead of embedding directory segments in the pattern.
This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗