Allow per-agent-type model overrides in settings
Resolved 💬 3 comments Opened Mar 23, 2026 by ojohnnymossa Closed Mar 27, 2026
Problem
Built-in subagent types (Explore, Plan, etc.) have hardcoded default models. When a user has many MCP servers configured, the combined tool definitions overflow smaller models' context windows, causing subagents to fail silently with "Prompt is too long" and 0 tokens used.
Current behavior
- The Explore agent defaults to Haiku for speed
- Each MCP server injects tool definitions into the subagent's context
- With ~13+ MCP servers, the system prompt alone exceeds Haiku's context limit
- The agent returns immediately with 0 tokens / 0 tool uses — no error surfaced to the user
- The only workaround is passing
model: sonnetper-invocation, which requires knowing about this issue
Proposed solution
Add a subagentModelOverrides setting (or similar) in settings.json / settings.local.json:
{
"subagentModelOverrides": {
"Explore": "sonnet",
"Plan": "sonnet"
}
}
This would let users with heavy MCP setups configure larger models for subagent types that can't fit their context.
Additional considerations
- Subagents probably shouldn't inherit all MCP tool definitions — Explore only needs Read/Glob/Grep/Bash, but currently gets 300+ MCP tools
- The "Prompt is too long" failure is silent — surfacing it as a visible error/warning would help users diagnose the issue
- An alternative approach: filter tool definitions passed to subagents based on which tools the agent type actually has access to
Environment
- macOS, Claude Code CLI
- Model: opus[1m]
- ~13 MCP servers configured (PostHog, Linear, Notion, Todoist, Slack, Granola, Langfuse, shadcn, AG Grid, BrowserMCP, Chrome DevTools, Figma)
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗