Explore agent always fails with "Prompt is too long" when many MCP tools are connected
Description
The Explore subagent (subagent_type: "Explore") consistently fails to launch with Prompt is too long when the parent session has many MCP server integrations connected. The agent never executes a single tool call — it fails immediately on spawn.
Steps to Reproduce
- Have multiple MCP integrations connected (Claude.ai integrations like PostHog, Asana, Gmail, Google Calendar, Slack, Circleback + local MCP servers like Playwright, Chrome, Context7, GitHub)
- Spawn an Explore agent with any prompt:
````
Agent(subagent_type="Explore", prompt="Search for how chat responses are streamed")
Expected Behavior
Explore agent starts and performs the search.
Actual Behavior
Prompt is too long
agentId: aef62ee12afe5392a
total_tokens: 0
tool_uses: 0
duration_ms: 789
The agent returns immediately with zero tokens used and zero tool calls. This happens 100% of the time regardless of how short the user prompt is.
Analysis
The likely cause is MCP tool definitions filling the subagent's context window. In our setup:
- ~230+ MCP tools are listed as deferred tools (PostHog ~100, Playwright ~20, GitHub ~30, Asana ~20, plus Gmail, Calendar, Slack, Circleback, Chrome, Context7)
- Even as deferred name-only listings, 230+ tool names plus MCP server instruction blocks and skill definitions add up significantly
- The CLAUDE.md files are only ~30KB — small relative to context limits
The Explore agent description says it has access to "All tools except Agent, ExitPlanMode, Edit, Write, NotebookEdit". If it inherits all MCP tool definitions from the parent session, that's the bottleneck. The general-purpose Agent works fine with the same project, presumably because it has a larger context budget.
The Explore agent should either:
- Not inherit MCP tool definitions it can't use (it only needs Read, Grep, Glob, Bash, LS)
- Use a model with sufficient context for the inherited tool set
- Strip MCP tools from the subagent context since Explore is specifically for codebase navigation
Workaround
Use Glob and Grep tools directly, or use the general-purpose Agent type.
Environment
- macOS (Darwin 25.2.0, arm64)
- Claude Code CLI
- Model: claude-opus-4-6 (1M context)
- ~230+ MCP tools across 10+ integrations
6 Comments
Found 2 possible duplicate issues:
This issue will be automatically closed as a duplicate in 3 days.
🤖 Generated with Claude Code
Also hitting this consistently on macOS (Darwin 25.2.0, arm64) with Claude Code CLI on Opus 4.6 (1M context).
My setup has ~6 MCP servers in
.mcp.json(Sentry, Linear, Figma, Playwright, Datadog, GraphQL) plus cloud integrations (PostHog, Ahrefs, Notion, Stripe, n8n, MongoDB, Chrome). The deferred tool list easily exceeds 300+ tool names.Every Explore agent spawn fails immediately with
Prompt is too long— 0 tool uses, 0 tokens, ~1s duration. General-purpose agents work fine since they use the parent model's 1M context window.Confirming the analysis: the root cause is MCP tool definitions being injected into the Explore agent's Haiku context (200K limit). Even with a one-line prompt, it's already over budget before any work begins.
Using general-purpose agents as a workaround for now.
Additional data point — Claude Opus 4.6 (1M context), 8 MCP servers
Same issue here. Explore agents fail consistently, and even general-purpose agents sometimes hit autocompact thrashing.
Setup:
claude-opus-4-6(1M context window)Observed behavior:
Workaround attempted: None effective. The only option is to avoid Explore agents entirely and use Grep/Glob/Read directly from the main conversation, which defeats the purpose of delegation.
Suggestion: Subagents should receive a filtered tool set. An Explore agent only needs Read, Grep, Glob, Bash, and WebSearch/WebFetch — inheriting 150 MCP tool definitions it will never use is pure context waste. The feature request in #38044 would solve this.
Session: 5h+ deep session, 2026-04-07, macOS Darwin 25.4.0.
Explore mode inheriting the entire MCP universe makes it almost unusable on heavy setups. If anyone is blocked by this, I put together a lightweight Go proxy (toolc) that mitigates it. You can point Explore at a compiled, filtered endpoint instead of the raw servers. It's just a band-aid until Claude Code fixes subagent inheritance, but it does the job today.
Repo: https://github.com/aak204/Tool-Catalog-Compiler
I ran into this myself. Claude suggested actually creating a custom Explore subagent that override the default Explore. The agent is then configured to not have access to the MCP tools. Seems to have worked as I'm not getting the same issue.
+1 this is a huge blocker