[BUG] Custom fileSuggestion causes MCP resources to appear in @ file picker

Resolved 💬 3 comments Opened Mar 4, 2026 by ethanbates-ez Closed Mar 8, 2026

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 fileSuggestion replaces the default picker

Error Messages/Logs

N/A — no errors, the behavior is purely in the UI picker.

Steps to Reproduce

  1. Configure any MCP server (e.g. Slack MCP, gworkspace, etc.) in ~/.claude.json
  2. Add a custom fileSuggestion to ~/.claude/settings.json:

``json
{
"fileSuggestion": {
"type": "command",
"command": "/path/to/file-suggestion.sh"
}
}
``

  1. Restart Claude Code
  2. Type @ followed by any text (e.g. @dev.yml)
  3. Observe: MCP resources appear in the file picker alongside filesystem results, regardless of query relevance (e.g. @dev.yml matches playground-slack-mcp:slack-mcp://docs/auth-help)
  4. Remove the fileSuggestion config, restart, and repeat
  5. 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 (21 docs://tools/* resources) and playground-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.yml surfacing slack-mcp://docs/auth-help suggests no fuzzy matching is applied to MCP resources.
  • Related: #20065 (poor fuzzy matching in default @ picker motivated the custom fileSuggestion)
  • Related: #22737 (fileSuggestion query not passed via stdin — appears fixed in 2.1.68)

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗