Search tool doesn't find anything when user has custom `~/.config/ripgrep/.ripgreprc` present
Status Fixed / completed
Maintainer reply ✓ Yes — ant-kurt
Workaround ✓ Mentioned in thread ↓
Activity 11 comments · opened Sep 4, 2025 · closed Oct 27, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator)
responded on this thread — see the highlighted reply below.
Search tool doesn't find anything when user has custom ~/.config/.ripgreprc present.
I'm also experiencing this issue - the below report was closed as stale. So here is me reopening it.
Ok I figured it out! Like a few different variations of issues have mentioned, the issue is with ripgrep! The issue specifically is having a ripgrep config file (~/.config/.ripgreprc) set on my system. I am on Windows using Claude Code through WSL2 (arch) and using zsh (if any of that matters). The solution for me was to add to the Claude Codesettings.jsonfile theRIPGREP_CONFIG_PATHenvironment variable setting it to a "dummy" value (so it does not load a custom ripgrep config in claude code)! ``json { "env": { "RIPGREP_CONFIG_PATH": "dummy" }, }`TheUSE_BUILTIN_RIPGREPenv variable (as others have mentioned helped them) did NOT work for me for some reason, butRIPGREP_CONFIG_PATHdid work! NOTE: This actually solved FOUR different issues for me!! 1./agentsnot showing up 2.@file autocompletion not working properly 3./custom-slash-commands` not showing up 4. Search / Grep tools always showing "0 results found" I am going to link all the issues that relate to these problems below so that this message shows up linked in those comments! - https://github.com/anthropics/claude-code/issues/2288 - https://github.com/anthropics/claude-code/issues/1843 - https://github.com/anthropics/claude-code/issues/5284 - https://github.com/anthropics/claude-code/issues/5256 - https://github.com/anthropics/claude-code/issues/5185 - https://github.com/anthropics/claude-code/issues/5182 - https://github.com/anthropics/claude-code/issues/5062 - https://github.com/anthropics/claude-code/issues/4632
_Originally posted by @GitMurf in #4741_
11 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
What's in your
~/.config/.ripgreprc, i.e. does finding zero results align with the exclusions you have set?If not, can you run
claude --debugand see if you have anyrg/ripgreperrors logged?@ant-kurt this is my
ripgreprc:and the exclusions don't align - i.e. if Claude runs
ripgrep SOMETHINGit will find stuff while its ownSearch()tool won't.And this is the relevant debug log:
rg error (signal=null, code=2, stderr: rg: unrecognized flag --ripgrep), 0 results
this is a major problem for me too. here's what i have
Note that the workaround with bogus env variable works for me.
I've created a StackOverflow Q&A to increase visibility of the issue and the workaround: https://stackoverflow.com/questions/79759550/claude-codes-internal-search-tool-always-shows-0-results-even-when-it-should-o/79759551#79759551
@ant-kurt I see this is tagged as
platform:linuxbut I encountered it onmacOS. Might beunix-wide.confirmed it exists on macos and linux. i'm still using this fix on Arch WSL and macOS and it works but there are bugs when Claude decides to use ripgrep sometimes. Please fix
I had RIPGREP_CONFIG_PATH set to a custom path and claude-code hates that.
here's a fix from my dotfiles:
Now on latest Claude I suddenly get issues when Claude calls ripgrep through bash (having the above dummy workaround in my claude config):
I fixed that by creating an empty file
.emptyripgreprcthat I then use instead ofdummy:Hey folks - this should be resolved in the next release, which also drops support for custom ripgrep configs in Claude Code.
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.