Glob tool fails to find files on Windows/MSYS when using recursive patterns or default working directory

Resolved 💬 3 comments Opened Jan 17, 2026 by ooo27 Closed Jan 21, 2026

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:

  1. No path specified (should default to working directory):
  • Pattern: *.md → No files found
  • Reality: CLAUDE.md exists in working directory
  1. Recursive patterns from root:
  • Pattern: **/*Commandlet*.cpp → No files found
  • Reality: Multiple matching files exist in subdirectories
  1. Explicit root path with pattern:
  • Pattern: *.md with path D:\projects\myproject → No files found
  1. Recursive pattern with explicit path:
  • Pattern: **/*.cpp with path D:\projects\myproject\src → Returns results but silently skips some files (e.g., jumps from BodyType.cpp to BulletBase.cpp, skipping BotController.cpp alphabetically)

Workaround that works

Providing a deep explicit path to the target directory:

  • Pattern: *Commandlet*.cpp with path D:\projects\myproject\src\Game\SourceWorks 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

  1. On Windows with MSYS/Git Bash environment
  2. Set working directory to a project root (e.g., D:\projects\myproject)
  3. Have a file at root level (e.g., CLAUDE.md)
  4. Run Glob with pattern *.md and no path specified
  5. Observe "No files found" despite file existing
  6. 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.

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗