[BUG] Glob silently fails when large .gitignore'd directories cause ripgrep timeout
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
The Glob tool silently fails with "No files found" when the search takes longer than ~10 seconds. This happens because:
- Glob uses
--no-ignore --hiddenflags, causing ripgrep to scan directories that are in.gitignore - Large ignored directories (e.g.,
tmp/storagewith ActiveStorage files) cause the search to exceed the timeout - Claude Code sends SIGTERM to kill ripgrep, resulting in 0 results instead of an error
In my case, a 107GB tmp/storage/ directory (ActiveStorage development files, listed in .gitignore) caused every Glob search to fail silently.
What Should Happen?
Either:
- Glob should respect
.gitignorepatterns (remove--no-ignoreflag), or - The timeout should be longer/configurable, or
- At minimum, Glob should return an error message when ripgrep is killed by timeout instead of silently returning "No files found"
Error Messages/Logs
Debug output shows ripgrep being killed with SIGTERM:
2026-01-02T05:22:11.913Z [DEBUG] rg error (signal=SIGTERM, code=null, stderr: ), 0 results
2026-01-02T05:22:11.913Z [ERROR] Error: Error: Command failed: /opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg --files --glob Gemfile --sort=modified --no-ignore --hidden /Users/jeremy/src/project/rails
Running the same command manually confirms the timeout issue:
$ time /opt/homebrew/lib/node_modules/@anthropic-ai/claude-code/vendor/ripgrep/arm64-darwin/rg --files --glob Gemfile --sort=modified --no-ignore --hidden /Users/jeremy/src/project/rails
/Users/jeremy/src/project/rails/Gemfile
0.20s user 2.72s system 27% cpu 10.479 total
The search takes 10.5 seconds and finds the file correctly - but Claude Code kills it before completion.
Steps to Reproduce
- Create a Rails project (or any project with large ignored directories)
- Have a large directory that's in
.gitignore(e.g.,tmp/storagewith >1GB of files) - Run any Glob search:
Glob(pattern: "Gemfile") - Result: "No files found" (incorrect)
- Remove the large ignored directory
- Run the same Glob search
- Result: File is found correctly
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.76
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Terminal.app (macOS)
Additional Information
Related to #15248 which describes a similar silent failure mode (permission denied errors).
The core issue is that --no-ignore causes ripgrep to scan directories that developers intentionally excluded via .gitignore. For Rails projects, tmp/ commonly contains ActiveStorage files, cache, and other large artifacts that shouldn't affect code search.
Workaround: Remove or reduce the size of large ignored directories (e.g., rm -rf tmp/storage).
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗