[BUG] Ripgrep breaks _everything_

Status Fixed / completed
Maintainer reply ✓ Yes — ant-kurt
Activity 10 comments · opened Jul 30, 2025 · closed Aug 20, 2025
💡 Likely answer: A maintainer (ant-kurt, collaborator) responded on this thread — see the highlighted reply below.

Environment

  • Platform (select one):
  • [X] Anthropic API
  • [ ] AWS Bedrock
  • [ ] Google Vertex AI
  • [ ] Other:
  • Claude CLI version: v1.0.63
  • Operating System: Ubuntu 22.04
  • Terminal: bash

Bug Description

When you have rg (RipGrep) installed on your system, Claude will try to use it. However, there's something wrong with Claude's usage of it, it will always return "(no content)" (or similar).

If you tell Claude to execute Bash(rg something) .. it will return a blank. Even Bash(rg --version) will return an empty result.

However, if you tell Claude to pipe output to cat, e.g. Bash(rg --version | cat) ... then it will work. Ripgrep is basically detecting that Claude is not running in an interactive terminal (or some other jazz that I don't understand) and it won't output. I've seen this with other CLI tools, too, but rg is the most significant.

I'm not sure if this only applies to a certain version, or what, but calls to rg will always fail.

So, this was breaking my Search() tool and lots of other things. Slash commands were not being detected, agent files were not being detected, etc.

Steps to Reproduce

  1. Be me, or someone working on my Ubuntu VM (sorry, idk what's special about my env)
  2. Use the claude Search tool, or try to use slash commands, or agents

Expected Behavior

They should all work.

Actual Behavior

They don't work.

Additional Context

As a workaround, adding this to your settings.json will fix everything:

{
  "env": {
    "USE_BUILTIN_RIPGREP": 1
  },

Here's my rg info:

$ rg --version
ripgrep 12.1.0 (rev 1980630f17)
-SIMD -AVX (compiled)
+SIMD +AVX (runtime)

View original on GitHub ↗

10 Comments

commandodev · 1 year ago

I found a rg config issue which was messing my up : #4946

GitMurf · 1 year ago

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 Code settings.json file the RIPGREP_CONFIG_PATH environment variable setting it to a "dummy" value (so it does not load a custom ripgrep config in claude code)!

{
  "env": {
    "RIPGREP_CONFIG_PATH": "dummy"
  },
}

The USE_BUILTIN_RIPGREP env variable (as others have mentioned helped them) did NOT work for me for some reason, but RIPGREP_CONFIG_PATH did work!

NOTE: This actually solved FOUR different issues for me!!

  1. /agents not 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!

pseudotensor · 1 year ago

FYI I don't have a ~/.config/.ripgreprc on my linux systems but still seeing the 0 search results while normal grep works.

GitMurf · 1 year ago
FYI I don't have a ~/.config/.ripgreprc on my linux systems but still seeing the 0 search results while normal grep works.

@pseudotensor do your /agents and custom slash commands all show up? Does your @ tab file autocompletion work? I was having all of these problems plus the Search tool problems, and this solved them all!

GitMurf · 1 year ago
> FYI I don't have a ~/.config/.ripgreprc on my linux systems but still seeing the 0 search results while normal grep works. @pseudotensor do your /agents and custom slash commands all show up? Does your @ tab file autocompletion work? I was having all of these problems plus the Search tool problems, and this solved them all!

@pseudotensor here is without the fix to ignore ripgreprc... 0 results

<img width="505" height="103" alt="Image" src="https://github.com/user-attachments/assets/c6d4e16b-6520-4d7a-bfda-351de4566d10" />

And here it is after I get the ripgreprc ignored! ... 1 result

<img width="548" height="96" alt="Image" src="https://github.com/user-attachments/assets/78c0c43d-a6b6-4d87-a2de-5e72a07c4361" />

pseudotensor · 1 year ago

Maybe I just made stupid mistake, but on the system I didn't have ripgrep installed, now it is working after installing it. I'll keep your point in mind about the config file.

Seems claude code should have said ripgrep wasn't installed if it's going to fail and find 0 results for everything. Maybe it uses something else if ripgrep isn't around that is bad.

GitMurf · 1 year ago
Maybe I just made stupid mistake, but on the system I didn't have ripgrep installed, now it is working after installing it. I'll keep your point in mind about the config file. Seems claude code should have said ripgrep wasn't installed if it's going to fail and find 0 results for everything. Maybe it uses something else if ripgrep isn't around that is bad.

I would assume it fallsback to regular grep if ripgrep is not installed 🤷‍♂️

Either way it seems that indeed the main culprit in all these similar Claude Code issues have to do with ripgrep.

ant-kurt collaborator · 1 year ago

We shipped some improvements in 1.0.84 that should help diagnose / mitigate this:

See the above troubleshooting link if you're still having issues.

Murtagy · 1 year ago

Started to experience the same after last update @ant-kurt .
Making it to use the system ripgrep worked, but the built-in one was broken just recently

github-actions[bot] · 12 months ago

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.