[BUG] @ command includes .git files in autocomplete
Resolved 💬 27 comments Opened Sep 17, 2025 by nCubed Closed Jan 18, 2026
💡 Likely answer: A maintainer (ant-kurt, collaborator)
responded on this thread — see the highlighted reply below.
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 @ command file autocomplete includes git objects and internal git files (e.g., .git/objects/*, .git/refs/*, .git/hooks/*) in the file picker.
<img width="539" height="262" alt="Image" src="https://github.com/user-attachments/assets/f178b18b-a337-4dda-ac14-ae592b3cb78e" />
What Should Happen?
The @ command should exclude .git directory contents from file indexing and autocomplete, similar to how most developer tools ignore git internals.
Error Messages/Logs
N/A - No error messages, just unwanted behavior.
Steps to Reproduce
- Open Claude Code CLI in any git repository
- Type
@to trigger file autocomplete - Observe that git internal files appear in the list alongside project files
Claude Model
Sonnet (default)
Is this a regression?
Yes, this worked in a previous version
Last Working Version
_No response_
Claude Code Version
1.0.117 (Claude Code)
Platform
Anthropic API
Operating System
Ubuntu/Debian Linux
Terminal/Shell
WSL (Windows Subsystem for Linux)
Additional Information
Additional Context
- Attempted to exclude via
.claude/settings.local.jsonpermissions.deny patterns but this only affects file access, not indexing - This clutters the file picker and makes it harder to find actual project files
- Screenshot available showing the issue
27 Comments
Found 3 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
The other open issue is for "I can't @my-file/path anymore." - this issue is about the
@command including .git files/artifacts in the autocomplete.The same issue has been closed multiple times as duplicate, but they referenced issues are not duplicates:
Each of the above issues describe the same behavior, but are incorrectly closed as dup of a different, but related issue.
+1 on this. The duplicates are incorrectly tagged.
@nCubed I think @ is just passing through to
rg(though for the life of me idk why they don't default tofd), three questions:~/.config/ripgrep/configfile maybe?claude doctor?claude --debugand using @?/doctor- no issuesSame issue in both WSL/Ubuntu and Windows Powershell.
@avegancafe I'm not quit sure if you're implying this does not occur with your instance of Claude Code? Or?
Yes exactly @nCubed , this isn't happening with my ripgrep, e.g. this screenshot was taken inside of a git repo where there is most definitely a
.git/info/dir:<img width="732" height="476" alt="Image" src="https://github.com/user-attachments/assets/103bc60a-6d80-4ae8-8bf5-6de2b286922f" />
What does the actual output of
claude doctorsay though, can you post it? I have a hypothesis but I forget exactly what it says when it's using a borked version of ripgrep@nCubed can you try running
USE_BUILTIN_RIPGREP=0 claude, and @ mention files, an see if that works? I'm assuming you have a working version of ripgrep on your computer@avegancafe - issue remains. However, after a bit of experimentation, the
@stopped indexing.gitwhen I added an ignore file and and rgignore file for.git.Root of project
_Not sure which one took, but it's good enough for now._
Disclaimer
I do not consider this issue as closed, just a work-around.
@nCubed with
USE_BUILTIN_RIPGREP=0, what does/doctorsay now? Does it appropriately find your ripgrep installation?Appreciate the assist! I think I'm good w/ this for now. I'll leave this in the hands of the Anthropic team to resolve now.
I tried to above tests and also the env variable. My doctor says this on 2.0.1:
Nothing above has worked in removing the dotfiles that should be ignored.
Hm that's so interesting @AnthonyRonning , it says it's using system ripgrep and yet still is returning files that shouldn't be returned by ripgrep by default. You don't have any
~/.config/ripgrep/configor~/.config/ripgrep/rcor anything?I did a
caton those two files and didn't see anything. This is my version in case it helps:same issue as @AnthonyRonning - no rg config files for rg at all.
USE_BUILTIN_RIPGREP=0does not help. i tried installing vianpm, as well asbun- same issuesof course arch btw
rg 14.1.1- and using it manually works as expected - filters./gitproperly.rgignoreis the only thing that works@AnthonyRonning have you tried with the
.ignoreor.rgignoreworkaround I posted earlier. Has worked for me and looks like @dekdevy as well.I did the other day. I can try again later. Perhaps it was cached or something? Was it instant for you as soon as you added them and relaunched Claude?
IIRC, yes. I added the ignore files, relaunched claude. No more
.gitnoise.Okay I spent about 15 minutes with claude on my system to get it to work:
--glob=!.git/
--glob=!.svn/
--glob=!.hg/
--glob=!node_modules/
etc...
RIPGREP_CONFIG_PATH = "$HOME/.ripgreprc";
USE_BUILTIN_RIPGREP = "0"; # This is the key one!
Half of my problem was nix specific things but happy to say it works, appreciate the help and pointers!
FYI our next release will be dropping support for custom ripgrep configs in Claude Code. This was unfortunately necessary to prevent some other issues with custom configurations breaking Claude Code.
Can you try the other solutions in this thread, such as the ignore file or using the non-built in ripgrep? If there are still issues, we can look into how to re-enable custom configs with some guardrails around it.
This is still a problem. Any solutions or workarounds?
<img width="534" height="229" alt="Image" src="https://github.com/user-attachments/assets/4d51de08-2638-412a-a70c-48959b57226e" />
<img width="682" height="253" alt="Image" src="https://github.com/user-attachments/assets/61bd22d1-9b2c-46c8-a952-9822762a6f3a" />
@ant-kurt
im a little bit confused on what the current methods should be, and whether exactly (and when) it broke. im using .rgignore and it is still working on (2.0.30), but without rgignore it is still broken.
can you give an up to date list of actions that users can try and from which version this change happened?
If this is going to be the case, then can you just figure out how to exclude unnecessary files correctly?
This is the commit i made to ignore these user wide if anyone else comes across this bug and wants to know the fix https://github.com/tal/dotfiles/commit/9bcb221033e6abdb0339cbda2b1e02be9953760f
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
This issue has been automatically closed due to 60 days of inactivity. If you're still experiencing this issue, please open a new issue with updated information.
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.