Feature Request: Add Optional Model Parameter to Sub-Agents

Resolved 💬 5 comments Opened Jul 25, 2025 by freiit 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 model is specified: The sub-agent uses the specified model
  • If model is 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...

View original on GitHub ↗

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