Glob tool fails to find files on Windows/MSYS when using recursive patterns or default working directory
Environment
- Platform: Windows (MSYS_NT-10.0-19045)
- Working directory:
D:\projects\myproject(bash reports/d/projects/myproject)
Observed behavior
Glob returns "No files found" in these scenarios, even though files exist and are findable via ls and the Grep tool:
- No path specified (should default to working directory):
- Pattern:
*.md→ No files found - Reality:
CLAUDE.mdexists in working directory
- Recursive patterns from root:
- Pattern:
**/*Commandlet*.cpp→ No files found - Reality: Multiple matching files exist in subdirectories
- Explicit root path with pattern:
- Pattern:
*.mdwith pathD:\projects\myproject→ No files found
- Recursive pattern with explicit path:
- Pattern:
**/*.cppwith pathD:\projects\myproject\src→ Returns results but silently skips some files (e.g., jumps fromBodyType.cpptoBulletBase.cpp, skippingBotController.cppalphabetically)
Workaround that works
Providing a deep explicit path to the target directory:
- Pattern:
*Commandlet*.cppwith pathD:\projects\myproject\src\Game\Source→ Works correctly
Expected behavior
All patterns should work consistently regardless of path depth or whether using ** recursion.
Impact
High - Glob is typically the first tool used for file discovery. Silent failures (returning "No files found" rather than an error) lead to incorrect conclusions about codebase contents. In this case, Claude (Opus 4.5) concluded a file didn't exist when it was actually present, and only discovered the issue when the user pointed out the file definitely existed.
Possible cause
Path format mismatch between Windows (D:\projects\myproject) and MSYS (/d/projects/myproject) environments may be confusing the underlying glob implementation. The Grep tool works correctly from the same working directory, suggesting the issue is specific to Glob's path handling.
Reproduction steps
- On Windows with MSYS/Git Bash environment
- Set working directory to a project root (e.g.,
D:\projects\myproject) - Have a file at root level (e.g.,
CLAUDE.md) - Run Glob with pattern
*.mdand no path specified - Observe "No files found" despite file existing
- Run Grep with pattern
CLAUDE- observe it finds the file correctly
Analysis
This issue was discovered and analyzed by Claude (Opus 4.5) during a coding session. The discrepancy between Glob and Grep behavior on the same working directory strongly suggests a path normalization issue specific to the Glob implementation on Windows/MSYS environments.
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗