[BUG] Custom fileSuggestion causes MCP resources to appear in @ file picker
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 using a custom fileSuggestion command in settings.json (to improve file picker performance on large monorepos — see #20065), the @ file picker begins displaying MCP server resources alongside filesystem results. These MCP resources are not filesystem objects and should never appear in the file picker.
The default built-in file picker does not exhibit this behavior — MCP resources only leak into the picker when a custom fileSuggestion command is configured.
With custom fileSuggestion enabled — typing @dev.yml:
+ hub/dev.yml ← correct (from custom script)
◇ playground-slack-mcp:slack-mc… ← MCP resource (should not appear)
+ davies/dev.yml ← correct
+ inference/dev.yml ← correct
With default file picker (no custom fileSuggestion) — same query:
+ hub/dev.yml
+ ../upi/dev.yml
+ davies/dev.yml
+ ../costs/dev.yml
+ ../../tools/dev/
+ inference/dev.yml
No MCP resources appear with the default picker.
Context: Why a custom fileSuggestion?
In large monorepos (e.g. Shopify's World monorepo with 1000+ zones), the default file picker is slow and returns poor fuzzy matches (as described in #20065). A custom fileSuggestion command using rg --files | fzf --filter provides significantly faster, scoped file discovery:
{
"fileSuggestion": {
"type": "command",
"command": "~/.claude/file-suggestion.sh"
}
}
#!/bin/bash
query=$(cat | jq -r '.query // ""')
cd "${CLAUDE_PROJECT_DIR:-.}" || exit 1
rg --files --hidden --follow \
--glob '!.git/' \
--glob '!node_modules/' \
2>/dev/null \
| fzf --filter "$query" \
| head -15
The script works correctly — returns the right files, receives the query via stdin, and is fast.
What Should Happen?
The @ file picker should not display MCP resources when a custom fileSuggestion command is configured. MCP resources are not filesystem objects and have no place in the file picker UI.
If MCP resources must be referenceable via @, they should be:
- In a separate section clearly distinguished from files
- Filtered by the query (not shown unfiltered)
- Not shown when a custom
fileSuggestionreplaces the default picker
Error Messages/Logs
N/A — no errors, the behavior is purely in the UI picker.
Steps to Reproduce
- Configure any MCP server (e.g. Slack MCP, gworkspace, etc.) in
~/.claude.json - Add a custom
fileSuggestionto~/.claude/settings.json:
``json``
{
"fileSuggestion": {
"type": "command",
"command": "/path/to/file-suggestion.sh"
}
}
- Restart Claude Code
- Type
@followed by any text (e.g.@dev.yml) - Observe: MCP resources appear in the file picker alongside filesystem results, regardless of query relevance (e.g.
@dev.ymlmatchesplayground-slack-mcp:slack-mcp://docs/auth-help) - Remove the
fileSuggestionconfig, restart, and repeat - Observe: MCP resources no longer appear — only filesystem results
Claude Model
Opus
Is this a regression?
I don't know
Last Working Version
N/A
Claude Code Version
2.1.68 (Claude Code)
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
iTerm2
Additional Information
- Every configured MCP server contributes noise — tested with both
gworkspace(21docs://tools/*resources) andplayground-slack-mcp(slack-mcp://docs/*resources). Removing MCP servers eliminates their resources from the picker, confirming the source. - MCP resources appear unfiltered — they show up regardless of whether the query matches the resource URI.
@dev.ymlsurfacingslack-mcp://docs/auth-helpsuggests no fuzzy matching is applied to MCP resources. - Related: #20065 (poor fuzzy matching in default
@picker motivated the customfileSuggestion) - Related: #22737 (
fileSuggestionquery not passed via stdin — appears fixed in 2.1.68)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗