[BUG] Glob silently fails when large .gitignore'd directories cause ripgrep timeout

Resolved 💬 3 comments Opened Jan 2, 2026 by jhubert Closed Jan 5, 2026

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:

  1. Glob uses --no-ignore --hidden flags, causing ripgrep to scan directories that are in .gitignore
  2. Large ignored directories (e.g., tmp/storage with ActiveStorage files) cause the search to exceed the timeout
  3. 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:

  1. Glob should respect .gitignore patterns (remove --no-ignore flag), or
  2. The timeout should be longer/configurable, or
  3. 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

  1. Create a Rails project (or any project with large ignored directories)
  2. Have a large directory that's in .gitignore (e.g., tmp/storage with >1GB of files)
  3. Run any Glob search: Glob(pattern: "Gemfile")
  4. Result: "No files found" (incorrect)
  5. Remove the large ignored directory
  6. Run the same Glob search
  7. 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).

View original on GitHub ↗

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