Explore agent always fails with "Prompt is too long" when many MCP tools are connected

Open 💬 6 comments Opened Mar 25, 2026 by natebransc

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

  1. Have multiple MCP integrations connected (Claude.ai integrations like PostHog, Asana, Gmail, Google Calendar, Slack, Circleback + local MCP servers like Playwright, Chrome, Context7, GitHub)
  2. 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:

  1. Not inherit MCP tool definitions it can't use (it only needs Read, Grep, Glob, Bash, LS)
  2. Use a model with sufficient context for the inherited tool set
  3. 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

View original on GitHub ↗

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