@-mention file picker doesn't search additionalDirectories / --add-dir directories
Summary
The @-mention file-reference picker in the interactive prompt only appears to index files under the primary working directory (cwd). Files reachable via permissions.additionalDirectories (settings.json) or via the --add-dir launch flag are not surfaced by the picker at all, even though both mechanisms correctly grant tool file-access (Read/Bash/Grep) to those directories.
This is confusing because additionalDirectories/--add-dir do successfully make a directory usable by tools, so users reasonably expect @-mention (the interactive equivalent) to work the same way.
Repro
- Two sibling repos, e.g.
~/project-Aand~/project-B. - In
~/project-A/.claude/settings.json:
``json``
{ "permissions": { "additionalDirectories": ["../project-B"] } }
cd ~/project-A && claude— confirmRead/Bash/Grepcan already reach files under../project-B(they can).- In the interactive prompt, type
@followed by the start of a filename that exists only underproject-B(not underproject-A). - Expected: the file shows up as a suggestion, same as a file under cwd would.
- Actual: no suggestions appear at all.
- Relaunching with
claude --add-dir ../project-Binstead (or in addition) makes no difference — same empty result.
Verification method
Confirmed by driving an actual interactive session via a Python pty + pyte terminal emulator (not just reasoning from docs), typing the @-mention keystrokes and capturing the rendered screen. A positive control — @-mentioning a file that does live directly under cwd — correctly surfaced a suggestion in the same test harness, showing the harness itself isn't the reason for the empty result.
Suggested improvement
Have the @-mention picker's file index include permissions.additionalDirectories and any --add-dir paths, matching what tool file-access already allows. Short of that, it'd help to document clearly (in --add-dir/additionalDirectories docs) that the picker does not follow either mechanism, and that the workaround is to type the full/relative path manually.