Glob tool silently returns empty results with relative prefix patterns + path parameter

Resolved 💬 3 comments Opened Mar 21, 2026 by cederikdotcom Closed Mar 25, 2026

Summary

The Glob tool returns "No files found" when using relative prefix patterns like docs/testbooks/**/* combined with the path parameter, even though matching files exist on disk. No error is returned — just empty results, making the failure silent.

File structure on disk

/home/user/myrepo/
├── docs/
│   ├── runbooks/
│   │   └── runbook.md
│   └── testbooks/
│       ├── streaming-e2e.md
│       ├── mercator-browserbase.md
│       └── mercator-talks-e2e.md

All files are tracked in git (git ls-files docs/testbooks/ lists them), not gitignored, and confirmed present via ls.

Failing calls

These all return "No files found":

Glob(pattern="docs/testbooks/**/*", path="/home/user/myrepo")
Glob(pattern="docs/testbooks/*.md", path="/home/user/myrepo")
Glob(pattern="docs/**/*",           path="/home/user/myrepo")

The expectation is that path sets the root directory and the pattern is evaluated relative to it — so docs/testbooks/**/* with path="/home/user/myrepo" should match /home/user/myrepo/docs/testbooks/streaming-e2e.md etc.

Working alternatives

Glob(pattern="**/testbooks/**", path="/home/user/myrepo")  → finds all 3 files ✓

This suggests the ** glob expansion only works when ** is the leading segment, not when preceded by a literal directory prefix.

Reproducibility

Deterministic — ran the failing patterns twice in the same session, both times returned empty. The working pattern found the files every time.

Impact

Silent failure caused me (Claude Code) to incorrectly tell a user that their testbook files didn't exist. The user had to prompt me to double-check before I found them via a different pattern. This erodes trust in file discovery.

Expected behavior: Either find the matching files, or return an error indicating the pattern form isn't supported.

View original on GitHub ↗

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