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

[BUG] File autocomplete just stopped working (using @[Filename])

Open smaccoun opened this issue 7 months ago • 21 comments

Environment

  • Platform (select one):
    • [ X] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ ] Other:
  • Claude CLI version: 1.0.5 (Claude Code)
  • Operating System: macOS 15.4.1
  • Terminal: iTerm2

Bug Description

Not sure what happened but suddenly every time i try to use the @ symbol to start autocompleting a file, nothing actually happens. It doesn't sort or find any files. I don't think I changed anything with my claude configs, just upgraded

Steps to Reproduce

  1. Open claude code in iTerm2
  2. Start typing: "This is a file @Somefile"
  3. Observe using the @ symbol no longer autocomplete

Expected Behavior

It should start autocompleting

Actual Behavior

It doesn't :(

Additional Context

I dont think anything changed via configs (I certainly didn't change anything), but I'll look for this

smaccoun avatar May 28 '25 23:05 smaccoun

+1

rayeddev avatar May 29 '25 02:05 rayeddev

Same issue! Also, it only happens on one repository, other repos I have show file suggestions as expected.

quezadaesteban avatar May 29 '25 13:05 quezadaesteban

Same issue! Also, it only happens on one repository, other repos I have show file suggestions as expected.

That's a really interesting point @quezadaesteban I just discovered the same thing. The @ autocomplete works in any other repo (I just tested a bunch of random ones), but in the giant production monorepo I've been working out of a while it just completely stopped yesterday. So at least its not a system issue....

smaccoun avatar May 29 '25 13:05 smaccoun

I'm also having the same issue after updating when using Claude Code in a large monorepo. Downgrading to 1.04 fixes the issue for me. M4 MacOS Sequoia.

peterbedorjr avatar May 29 '25 15:05 peterbedorjr

I'm also having the same issue after updating when using Claude Code in a large monorepo. Downgrading to 1.04 fixes the issue for me. M4 MacOS Sequoia.

Can confirm fix for now is just to downgrade

npm i -g @anthropic-ai/[email protected]

claude --version

smaccoun avatar May 29 '25 16:05 smaccoun

I had the same autocomplete issue in a largish monorepo, but hit the bug described in #1392 after downgrading to 1.0.4. Downgrading to 1.0.3 fixed both things for me

npm install -g @anthropic-ai/[email protected]
claude config set -g autoUpdaterStatus disabled

joshcurtis avatar May 29 '25 17:05 joshcurtis

Same here (Not sure if it matters but I also migrated to the local install)

poppabear8883 avatar May 29 '25 20:05 poppabear8883

Note, the issue seems to resolve itself with a fresh clone of the repository. Not sure what the cause of the initial issue, but hopefully this can shed some light onto it.

poppabear8883 avatar Jun 04 '25 15:06 poppabear8883

Same, after upgrade to 1.0.5 autocomplete doesn't work, config is not respected, etc

nick4fake avatar Jun 05 '25 21:06 nick4fake

My issue was described in #1444 and autocomplete started working for me once I removed a broken symlink which I found by running rg --files --follow . >/dev/null


I had claude code beautify then compare cli.js from the claude code node module. It seems to think the problem was caused because claude started listing files with rg --files --follow, instead of rg --files, but that command returns exit code 2 if it encounters any broken symlinks and claude isn't properly handling that exit code so it just failed silently

joshcurtis avatar Jun 06 '25 18:06 joshcurtis

My issue was described in #1444 and autocomplete started working for me once I removed a broken symlink which I found by running rg --files --follow . >/dev/null

I had claude code compare beautify then compare cli.js from the claude code node module. It seems to think the problem was caused because claude started listing files with rg --files --follow, instead of rg --files, but that command returns exit code 2 if it encounters any broken symlinks and claude isn't properly handling that exit code so it just failed silently

Thank you @joshcurtis that totally worked for me!

smaccoun avatar Jun 07 '25 14:06 smaccoun

My issue was described in #1444 and autocomplete started working for me once I removed a broken symlink which I found by running rg --files --follow . >/dev/null

I had claude code compare beautify then compare cli.js from the claude code node module. It seems to think the problem was caused because claude started listing files with rg --files --follow, instead of rg --files, but that command returns exit code 2 if it encounters any broken symlinks and claude isn't properly handling that exit code so it just failed silently

Thank you @joshcurtis. Your description helped me solve a closely related issue: I had a sub-folder (attached to a Docker container) that my user, and hence Claude Code, did not have read access to. The rg --files --follow . >/dev/null command reported a Permission denied error for that folder, but unfortunately I cannot remove that folder. However, I found a solution by writing the folder's path to an .ignore file in the top-most folder, which the rg tool reads and adheres to.

mtr avatar Jun 08 '25 22:06 mtr

My issue was described in #1444 and autocomplete started working for me once I removed a broken symlink which I found by running rg --files --follow . >/dev/null

I had claude code compare beautify then compare cli.js from the claude code node module. It seems to think the problem was caused because claude started listing files with rg --files --follow, instead of rg --files, but that command returns exit code 2 if it encounters any broken symlinks and claude isn't properly handling that exit code so it just failed silently

it helpd, thank you bro!

maketeamake avatar Jun 09 '25 12:06 maketeamake

I have the same problem but rg reports no broken symlinks or other errors

mcantrell avatar Jun 13 '25 17:06 mcantrell

Hmm, I might actually be having a different issue if you guys aren't seeing any files at all. Mine seems to be more of a matching issue. For instance, I want to search for EmailRequestBuilder but only the E matches the file:

Image

If I typed Em it loses the file:

Image

I might open a different issue if this doesn't appear to be related.

mcantrell avatar Jun 13 '25 17:06 mcantrell

Hmm, I might actually be having a different issue if you guys aren't seeing any files at all. Mine seems to be more of a matching issue. For instance, I want to search for EmailRequestBuilder but only the E matches the file:

Image If I typed `Em` it loses the file: Image I might open a different issue if this doesn't appear to be related.

@mcantrell that is a differnt issue and one i started seeing around version 1.0.19 or 1.0.20 or so. Not sure tbh but i had to downgrade again to 1.0.18 and it went away and searches all files again

smaccoun avatar Jun 13 '25 18:06 smaccoun

OK, I'll sniff around and see if there's already an open issue or add a new one.

mcantrell avatar Jun 13 '25 18:06 mcantrell

Can confirm, downgrading to 1.0.18 solves the problem for me (macos, also had no broken symlink).

norbertbanyai avatar Jun 13 '25 19:06 norbertbanyai

Same for me - downgrading to 1.0.18 solved it (MacOS, no broken symlinks)

phiob avatar Jun 16 '25 07:06 phiob

Same for me - downgrading to 1.0.18 solved it (Ubuntu 24.04)

Hmm, I might actually be having a different issue if you guys aren't seeing any files at all. Mine seems to be more of a matching issue. For instance, I want to search for EmailRequestBuilder but only the E matches the file: Image If I typed Em it loses the file: Image I might open a different issue if this doesn't appear to be related.

@mcantrell that is a differnt issue and one i started seeing around version 1.0.19 or 1.0.20 or so. Not sure tbh but i had to downgrade again to 1.0.18 and it went away and searches all files again

leonardocouy avatar Jun 16 '25 19:06 leonardocouy

After analyzing the issue using Claude Code itself, it seems there is some hard limit / timeout for number of files ripgrep can process (it says 10000). Adding more files to .rgignore resolves the issue for me (rg --files --follow . | wc -l = ~15000 files in my case).

EgorDuplensky avatar Jun 25 '25 16:06 EgorDuplensky

Thanks @EgorDuplensky ! That was it for me!

$ rg --files --follow . | wc -l
64638

Set up .rgignore to exclude node_modules/:

$ cat .rgignore
node_modules/

Now rg is finding way less files and my auto-complete is working again!

$ rg --files --follow . | wc -l
215

RealLukeManning avatar Jul 07 '25 21:07 RealLukeManning

Following the suggestion about broken symlinks, I found and fixed the problem.

find . -type l -exec test ! -e {} \; -print

For others experiencing this issue: Check for broken symlinks using the find command above. Circular symlinks seem to break the file indexing for me.

Thanks to the earlier suggestions in this thread! 🎯

gouthamindukuri avatar Jul 12 '25 15:07 gouthamindukuri

This is still not working for me - it works on some folders but not consistently [no symlinks and sub 1000 files] Is this dependant on container configurations?

harshh-jainn avatar Jul 14 '25 10:07 harshh-jainn

This should be working better now:

  • v1.0.69 improved handling of large projects
  • v1.0.84 added a new "Search" line to claude /doctor which can help show if ripgrep is available
  • Upcoming release tomorrow will help WSL search /mnt directories + improve recovery on partial searches

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

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]