claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Report] File path completion may fail unless USE_BUILTIN_RIPGREP is enabled

Open budougumi0617 opened this issue 7 months ago • 1 comments

Environment

  • Platform (select one):
    • [x] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.16 (Claude Code)
  • Operating System: macOS 15.5
  • Terminal: iTerm2, Wezterm, Ghostty

Report

I discovered that the file path completion feature of the claude command may not work depending on how ripgrep is installed. I am creating this issue to share a workaround for other claude users who might encounter the same problem.

This issue can be avoided by setting an environment variable. Also, it is being discussed as an issue in the repository of the installation tool.

  • https://github.com/aquaproj/aqua/issues/3918

I installed the ripgrep command using aqua, which is a version management tool.

When I run the claude command in this environment, file path completion does not work.
However, if I use the ripgrep command installed via Homebrew, file completion works as expected.

Steps to Reproduce

  1. Install ripgrep globally using aqua with AQUA_GLOBAL_CONFIG.
    • Reference: https://aquaproj.github.io/docs/tutorial/global-config/
    $ which rg
    /Users/budougumi0617/.local/share/aquaproj-aqua/bin/rg
    $ ls -la $(which rg)
    lrwxr-xr-x@ 1 budougumi0617  staff  13 Mar  8 18:13 /Users/yoichiro.shimizu/.local/share/aquaproj-aqua/bin/rg -> ../aqua-proxy
    
  2. Run the claude command.
  3. Type @ to try file path completion.

Expected Behavior

File path completion works as expected.

Actual Behavior

File path completion does not work.

Additional Context

  • Reference: https://github.com/anthropics/claude-code/issues/155

If I enable the USE_BUILTIN_RIPGREP environment variable in ~/.claude/settings.json, file completion works.

$ cat ~/.claude/settings.json
{
  "env": {
    "USE_BUILTIN_RIPGREP": 1
  }
}

budougumi0617 avatar Jun 09 '25 13:06 budougumi0617

I installed ripgrep with homebrew, but file tagging also does work for me. Adding the setting "USE_BUILTIN_RIPGREP": 1 didn't work either.

which rg
/opt/homebrew/bin/rg

yimingli avatar Jun 12 '25 20:06 yimingli

I'm experiencing a custom slash command issue with the same setup. Markdown (.md) files in .claude/commands/ and ~/.claude/commands/ are not recognized as custom slash commands.

My setup is the same as described in this issue: rg (ripgrep) command installed by aqua. Setting "USE_BUILTIN_RIPGREP": 1 in the env also solved this issue.

pinelibg avatar Jul 03 '25 17:07 pinelibg

Setting the "USE_BUILTIN_RIPGREP": 1 did NOT solve the problem for me.

But setting my RIPGREP_CONFIG_PATH to "dummy" (so it does not load a custom ripgrep config in claude code) did solve the issue for me!

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

See my detailed write-up I did here: https://github.com/anthropics/claude-code/issues/4741#issuecomment-3177976916

GitMurf avatar Aug 12 '25 06:08 GitMurf

We shipped some changes for this recently. Next steps:

  • claude /doctor should tell you if Search (which includes @ file mentions and custom agents / slash commands) is working
  • If not, see https://docs.anthropic.com/en/docs/claude-code/troubleshooting#search-and-discovery-issues

ant-kurt avatar Aug 22 '25 22:08 ant-kurt

I think this issue will not occur from the below version. I appreciate your comments!! https://github.com/anthropics/claude-code/blob/main/CHANGELOG.md#1084

Use built-in ripgrep by default; to opt out of this behavior, set USE_BUILTIN_RIPGREP=0

budougumi0617 avatar Aug 23 '25 09:08 budougumi0617

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.

github-actions[bot] avatar Aug 30 '25 14:08 github-actions[bot]