[BUG] @ mentions don't work with additional directories include via add-dir command

Open 💬 17 comments Opened Sep 10, 2025 by deepakn97

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?

When I add a new directory using /add-dir command, the file suggestion system using @file does not include suggestions from the additional directories in the dropdown.
Note that providing the complete path to the file using the same syntax works fine. However, that adds a lot of friction for the user.

What Should Happen?

Once additional directories are added, claude-code should reindex the files and start suggesting files from additional directories in the dropdown.
Ideally, this should happen as soon as the directories are added (depending on the number of files to be indexed)

Error Messages/Logs

Steps to Reproduce

  1. Run /add-dir command in claude-code.
  2. Type @filename, note that it does not suggest the matching filename from the additional directories.

Claude Model

Not sure / Multiple models

Is this a regression?

I don't know

Last Working Version

_No response_

Claude Code Version

1.0.110

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

Cursor

Additional Information

So far, I have tried the following:

  1. Restart claude-code after adding an extra directory. Issue persists.
  2. Try installing and upgrading system ripgrep as suggested here. Issue persists.

Local Settings files (<project_dir>/.claude/settings.local.json):

{
  "permissions": {
    "additionalDirectories": [
       <additional_directory_paths>
    ]
  }
}

View original on GitHub ↗

17 Comments

github-actions[bot] · 10 months ago

Found 3 possible duplicate issues:

  1. https://github.com/anthropics/claude-code/issues/5605
  2. https://github.com/anthropics/claude-code/issues/5284
  3. https://github.com/anthropics/claude-code/issues/4748

This issue will be automatically closed as a duplicate in 3 days.

  • If your issue is a duplicate, please close it and 👍 the existing issue instead
  • To prevent auto-closure, add a comment or 👎 this comment

🤖 Generated with Claude Code

deepakn97 · 10 months ago

Note that while this has been mentioned in other issues, every issue has been closed without providing a fix.

deepakn97 · 8 months ago

Hello,
Are there any updates on this issue? Due to this issue, working with multi-directory workspaces is very difficult.
Thank you

cmgrant0 · 8 months ago

Please fix, only files within my user and project .claude folders are being displayed, no other files

johnson86tw · 8 months ago

This issue should be resolved asap since it has been mentioned multiple times

cansar · 7 months ago

+1. This is blocking lots of workflows.

cmgrant0 · 7 months ago

make sure your .zshrc doesnt have anything weird going on, this may have fixed the problem for me

deepakn97 · 7 months ago

@cmgrant0 can you please provide more details on what you mean by weirdness in .zshrc? This issue remains unresolved for me, so I am curious.

github-actions[bot] · 6 months ago

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.

artwist-polyakov · 6 months ago

Issue is still occurring

Leeiio · 6 months ago

Issue is still occurring +1

subdavis · 5 months ago

Issue is still occurring. Commenting to reset the auto-close clock. It took me a while to find this open issue because it keeps getting reported and then auto-closed 😕 Thanks.

Edit: @noVaSon's use case is also what I was trying to do!

logandeyo · 4 months ago

Also resetting clock. Continuing to exist as a bug. Incredibly frustrating when working in two separate directories for say frontend and backend.

noVaSon · 4 months ago

Adding another data point with a specific use case: nested independent git repos (not submodules, not subtrees).

Setup: Root workspace repo with independent git repos nested inside:

```
workspace/ # git repo
|── .claude/settings.json # additionalDirectories: ["repo-a", "repo-b"]
|── .gitignore # ignores * except .claude/ config
|── .claudeignore # build artifact exclusions only
|── repo-a/ # independent git repo
| └── deep/nested/file.txt
── repo-b/ # independent git repo
└── deep/nested/file.txt


  **What I tried (Claude Code 2.1.71, macOS):**

  | Setting | Result |
  |---------|--------|
  | `additionalDirectories` only | Top-level dir name appears, no deeper autocomplete |
  | + `"respectGitignore": false` | Same - no deeper autocomplete |
  | + `"fileSuggestion"` with custom script | Breaks autocomplete entirely (zero suggestions), even though the script returns correct results when run from the shell |

  The `fileSuggestion` finding might be a separate bug - the script receives JSON on stdin, returns file paths on stdout, works perfectly in isolation, but Claude Code shows nothing.

  For now there's no workaround - typing the full path manually is the only option.
marcioaguiar · 2 months ago

Still not working.

FaraazSulaiman91 · 1 month ago

bump :)

artem-tamilin · 9 days ago

👍 Adding another real-world case where this hurts.

We run an internal multi-repo orchestration setup where claude is launched from a small per-session workspace directory, with the actual codebases (two large mobile repos, ~16–17k tracked files each) attached via --add-dir. Tools can read/edit those repos fine, but @ completion never offers anything from them — so every file reference has to be typed as a full absolute path from memory, which effectively kills the @ workflow for multi-repo use.

Re-verified on v2.1.202 (macOS, TUI) with scripted terminal probes: files under --add-dir roots never appear in the popup, regardless of index warm-up time or query specificity.

Two extra data points that may help whoever picks this up:

  • In a non-git cwd, the @ index follows directory symlinks into a large external repo (with proper .gitignore pruning inside it) — so symlinking the added dirs into the workspace is a viable workaround there 🎉
  • In a git cwd, directory symlinks are not traversed at all, so that workaround dies as soon as the workspace is a repo. Filed separately as #75347 since it's a distinct behavior (that issue also covers the gitignored-cwd case where the index ends up completely empty).

Would love to see --add-dir roots included in the completion index — for agent-launcher / multi-repo setups this is the main missing piece 🙏