claude-code - 💡(How to fix) Fix Explore agent defaults to Haiku, overflows with real-world MCP setups [1 comments, 2 participants]

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…
GitHub stats
anthropics/claude-code#45357Fetched 2026-04-09 08:07:19
View on GitHub
Comments
1
Participants
2
Timeline
5
Reactions
0
Timeline (top)
labeled ×4commented ×1

Fix Action

Workaround

Using Agent({ subagent_type: "Explore", model: "sonnet", prompt: "..." }) works.

RAW_BUFFERClick to expand / collapse

Problem

The built-in Explore agent defaults to model: "haiku". With a realistic set of MCP servers and plugins installed, the system prompt (MCP tool definitions, skill listings, plugin agent types, etc.) exceeds Haiku's prompt size limit, causing every Explore agent spawn to fail with "Prompt is too long."

Environment

  • Claude Code 2.1.96
  • ~200 MCP tools from 10+ servers (Supabase, Sentry, Slack, Stripe, Monday, Zoho, Vercel, Gmail, Playwright, Chrome DevTools, Context7)
  • 19 enabled plugins contributing skills and agent types

Reproduction

With the above environment, any Agent({ subagent_type: "Explore", prompt: "..." }) call fails with "Prompt is too long."

Testing

Agent TypeModelResult
general-purposeopus (inherited)Works
Explorehaiku (default)Fails
Exploreopus (override)Fails
Exploresonnet (override)Works

Two issues

  1. Explore should default to Sonnet (or inherit). Haiku can't handle real-world MCP tool surface area. The Explore agent already sets omitClaudeMd: true to save space, but the MCP tool definitions alone overflow Haiku.

  2. Model override should be respected by prompt size validation. When model: "opus" is specified, the agent still fails — suggesting the size check uses the agent type's default model limits, not the overridden model's limits.

Workaround

Using Agent({ subagent_type: "Explore", model: "sonnet", prompt: "..." }) works.

extent analysis

TL;DR

To fix the issue, override the default model for the Explore agent by specifying model: "sonnet" when creating the agent.

Guidance

  • The Explore agent's default model, "haiku", has a prompt size limit that is too small for the realistic set of MCP servers and plugins installed, causing the agent to fail.
  • To verify the issue, try creating an Explore agent with the default model and a prompt that exceeds the size limit, and check for the "Prompt is too long" error.
  • To mitigate the issue, override the default model by specifying model: "sonnet" when creating the Explore agent, as shown in the provided workaround.
  • Additionally, the model override should be respected by prompt size validation, so if a different model is specified, the size check should use the overridden model's limits.

Example

Agent({ subagent_type: "Explore", model: "sonnet", prompt: "..." })

Notes

The provided workaround suggests that using model: "sonnet" resolves the issue, but it may not be the only possible solution. Further investigation may be needed to determine the root cause of the problem and to find a more permanent fix.

Recommendation

Apply workaround: Use model: "sonnet" when creating the Explore agent, as it has been shown to resolve the issue in the provided testing.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING