Feature Request: Add Optional Model Parameter to Sub-Agents
Status Fixed / completed
Maintainer reply None cached
Activity 5 comments · opened Jul 25, 2025 · closed Jul 31, 2025
Feature Request: Add Optional Model Parameter to Sub-Agents
Description
Currently, sub-agents in Claude Code have the following structure:
---
name: your-sub-agent-name
description: Description of when this sub agent should be invoked
tools: tool1, tool2, tool3 # Optional - inherits all tools if omitted
---
Your sub agent's system prompt goes here. This can be multiple paragraphs
and should clearly define the sub agent's role, capabilities, and approach
to solving problems.
Include specific instructions, best practices, and any constraints
the sub agent should follow.
Proposed Enhancement
Add an optional model parameter to the sub-agent configuration that allows specifying which Claude model the sub-agent should use:
---
name: your-sub-agent-name
description: Description of when this sub agent should be invoked
tools: tool1, tool2, tool3 # Optional - inherits all tools if omitted
model: opus # Optional - inherits main agent's model if omitted
---
Your sub agent's system prompt goes here...
The model parameter should support the same values as the CLI --model flag:
- Model aliases:
sonnet,opus - Full model names:
claude-sonnet-4-20250514, etc.
Use Case
This feature would enable developers to:
- Use different models for different sub-agents based on task complexity
- Optimize costs by using lighter models for simpler sub-agent tasks
- Leverage specific model strengths for specialized sub-agents
Expected Behavior
- If
modelis specified: The sub-agent uses the specified model - If
modelis omitted: The sub-agent inherits the model from the main agent (current behavior) - Invalid model names should produce a clear error message
Example
---
name: code-reviewer
description: Reviews code for best practices and potential issues
tools: filesystem, search
model: sonnet # Use Sonnet for cost-effective code review
---
You are a code review specialist...
---
name: architect
description: Designs complex system architectures
tools: filesystem, search, web
model: opus # Use Opus for complex architectural decisions
---
You are a system architecture expert...
5 Comments
+1, this was the first feature I looked for when starting to use agents.
I default to opus but would like the ability to explicitly tell sub-agents to use sonnet without having to interrupt flow
+9000 - this is exactly what I had in mind and what 'felt natural' when I first saw the agent file format. I would like to assign opus as the main agent and use sonnet for all sub-agents save for say an architect agent.
+1 for this feature! Being able to specify different models per sub-agent would be incredibly valuable for optimizing both performance and costs. For example, using Sonnet for simpler tasks like code reviews while reserving Opus for complex architectural decisions makes perfect sense.
I'd also love to see this model parameter support extended to custom commands, allowing similar flexibility there as well. This would give developers fine-grained control over which model handles different types of tasks within their workflow.
Available since 1.0.64! 👍
This issue has been automatically locked since it was closed and has not had any activity for 7 days. If you're experiencing a similar issue, please file a new issue and reference this one if it's relevant.