[BUG] Glob and Grep tools silently return empty results for valid queries

Resolved 💬 10 comments Opened Feb 20, 2026 by Kenoubi Closed Apr 8, 2026

Problem

The Glob and Grep tools intermittently return "No files found" or "No matches found" when matches demonstrably exist. This is distinct from the timeout issues in #22379 and #16043 — it occurs on small directories where timeout is not a factor, and the equivalent find or rg command in Bash succeeds immediately.

Reproduction

This is intermittent, which makes it hard to provide a deterministic repro. The pattern observed:

  1. Run Glob(pattern="**/*.md", path="/some/project") → "No files found"
  2. Run find /some/project -name "*.md" via Bash → lists files correctly
  3. Re-run the same Glob call → sometimes works on retry

Similarly with Grep:

  1. Grep(pattern="some_function", path="/some/project") → "No matches found"
  2. grep -r "some_function" /some/project via Bash → finds matches
  3. Narrowing to a specific file path first sometimes makes it work

Workarounds

  • Fall back to Bash grep/find when Glob/Grep returns suspiciously empty results
  • Narrow the search path to a specific file or directory before trusting a broad "no results"

Environment

  • Platform: Linux (WSL2)
  • Observed consistently over ~5 weeks of daily use
  • Not correlated with repo size (happens in projects with <100 files)

Impact

This silently produces incorrect results — the model proceeds as if the file/pattern doesn't exist, leading to wrong conclusions or unnecessary recreation of existing files. It's particularly insidious because there's no error signal; the tool reports success with empty results.

View original on GitHub ↗

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