[BUG] @ file mentions cannot reference files inside nested git repositories (desktop Code tab)
@ file mentions cannot reference files inside nested git repositories
Environment
- Claude Code 2.1.260 (Agent SDK 0.3.260), entrypoint
claude-desktop - Claude Desktop 1.49585.0
- Linux 7.0.0-31-generic
Summary
In the desktop app's Code tab, the @ file-mention picker returns no suggestions
for any file located inside a nested git repository, even when that path is fully
readable by the agent and excluded from no ignore rule.
The agent process and the picker disagree about which files exist: the agent can
read and grep these files without issue, but the user cannot reference them.
Setup
A parent repo containing two independently-managed child repos, each with its own.git:
options_app/ <- parent repo, project root
├── .git/
├── ib_trading/ <- independent repo
│ ├── .git/
│ └── app.py
└── options_ui/ <- independent repo
└── .git/
Steps to reproduce
- Open the parent repo as the project in the desktop app's Code tab.
- Type
@app.pyin the input box (the file exists atib_trading/app.py).
Expected
ib_trading/app.py is suggested.
Actual
No suggestions appear. The same holds for every file under either child repo.@README.md (a file at the project root) works correctly, so the picker itself
is functional — it just never descends into the nested repos.
What we ruled out
This is not a .gitignore problem. Each was tested with a full app restart:
- A
.ignorefile negating the entries.ripgrephonors it — `rg --files
ib_trading` lists the files, and the agent's own search works. The picker is
unaffected.
respectGitignore: falsein project.claude/settings.json. No effect on
the picker. Project settings are being read: an env marker set in the same
file appeared in the agent's environment, confirming the file is loaded and
parsed. The setting is documented as "Whether file picker should respect
.gitignore files", but appears to govern only the CLI/TUI picker, not the
desktop one.
fileSuggestion: { type: "command", ... }in project settings. Documented
as "Custom file suggestion configuration for @ mentions". Pointed at a script
returning 894 paths including ib_trading/app.py. No effect on the picker.
- Removing the entries from
.gitignoreentirely. After restart, the child
repos were no longer ignored by git (git check-ignore confirmed), and the
picker still returned nothing for files inside them.
Step 4 is the important one: with no ignore rule in play at all, the picker still
skips these paths. That points at the directory walker stopping at the nested.git boundary (or enumerating only git-tracked files of the root repo), rather
than at ignore-rule handling.
permissions.additionalDirectories. Adding the child repos here grants the
agent permission scope but does not add them to the picker's index, and the
grants are dropped on restart.
Impact
Nested independent repositories are a common layout for a backend/frontend pair
developed together but released separately. In that layout the @ mention
feature — the primary way to point Claude at a specific file — is unusable for
essentially the entire codebase. The only workaround is to open each child repo
as its own project window, which gives up the cross-repo context that motivated
the parent workspace.
Suggested fix
Either have the desktop picker traverse into nested repositories (applying each
one's own ignore rules, which correctly excludes node_modules, __pycache__,
build output, etc.), or make it honor respectGitignore / fileSuggestion so
there is at least a documented escape hatch for this layout.
Related issues
- #14904 —
respectGitignore: falsenot honored by the file picker. Matches
finding 2 above; this report adds that the problem persists with no ignore rule
present at all, which suggests a second, independent cause.
- #94522, #7412 —
@autocomplete ignores additional working directories.
Matches finding 5 above.