Explore subagent always fails with "Prompt is too long" when many MCP servers are registered

Resolved 💬 4 comments Opened Apr 18, 2026 by mtford90 Closed Apr 21, 2026

Summary

The built-in Explore subagent (Agent tool with subagent_type: "Explore") fails every dispatch with Prompt is too long — even for trivial 10-character prompts — when many MCP servers are registered in the session. Other subagent types (general-purpose, Plan) accept the same prompt from the same parent conversation.

The error message blames the user prompt, but the user prompt is not the cause.

Environment

  • Claude Code CLI
  • macOS (Darwin 25.2.0)
  • Parent model: Claude Opus 4.7 (1M context)
  • Fresh session (repro happens on the very first subagent dispatch)
  • Parent context ≈ 27,000 tokens at session start (measured via another subagent's reported token usage)
  • MCP servers registered: context7, exa, langfuse, linear, posthog, procsi, railway, sentry, supabase, notion, plus Claude.ai-connected Gmail / Google Calendar / Google Drive, plus several local Claude Code plugins (obsidian, codex, agent-browser, dx, superpowers-*, frontend-design, etc.)

Reproduction

From a fresh Claude Code session with the above MCP servers registered:

| Tool call | Result |
|---|---|
| Agent(subagent_type: "Explore", prompt: "Reply hello") | Prompt is too long |
| Agent(subagent_type: "general-purpose", prompt: "Reply hello") | works (reports 26,817 parent-context tokens) |
| Agent(subagent_type: "Plan", prompt: "Reply hello") | works |

Prompt length is irrelevant — prompts from ~800 words down to 10 characters fail identically. Every subsequent Explore dispatch in the session also fails.

Hypothesis

Explore defaults to Haiku for speed. Haiku's practical context budget is smaller than Sonnet/Opus. Every subagent dispatch inherits the parent session's MCP tool schemas + available skills + CLAUDE.md contents — easily 20–30k tokens when many MCP servers are configured. This pushes the Explore dispatch over Haiku's budget before any user prompt is added, causing a blanket rejection.

The error wording ("Prompt is too long") points the user at their own prompt, which is the wrong diagnostic signal.

Impact

Explore is unusable for any session where a user has multiple MCP servers configured — an increasingly common setup, and arguably the default for serious users. Users end up falling back to general-purpose for exploration, losing Explore's speed advantage entirely.

Suggested fixes (any one would help)

  1. Route Explore to a larger model when inherited context exceeds Haiku's budget.
  2. Filter or summarise inherited MCP tool schemas before dispatching Explore (Explore's system prompt is small; the bloat is inherited, not intrinsic).
  3. Improve the error message to indicate inherited context (not user prompt) is the bottleneck.
  4. Respect subagentModelOverrides (requested in #37823) if/when it ships, so users can pin Explore to Sonnet/Opus.

Related issues (none describe this specific scenario)

  • #25714 — uncontrolled Explore parallelisation (different cause)
  • #29768 — Explore model inheritance mismatch
  • #37823 — per-subagent model override (would mitigate)
  • #46348 — auto-compact failures (adjacent)

View original on GitHub ↗

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