[BUG] Sub-agents Don't Inherit Model Configuration in Task Tool
Bug Report: Sub-agents Don't Inherit Model Configuration in Task Tool
Summary
When using the Task tool to spawn sub-agents, they default to Claude Sonnet 4 instead of inheriting the configured model (Claude Opus 4.1) from both global and local settings.
Environment
- Claude Code Version: 1.0.72
- Platform: Linux 6.8.0-65-generic
- Date: 2025-08-09
- Parent Model: claude-opus-4-1-20250805 (Claude Opus 4.1)
- Sub-agent Model: claude-sonnet-4-20250514 (Claude Sonnet 4)
Configuration
Both global and local settings explicitly request Opus model:
Global Settings (~/.claude/settings.json)
{
"$schema": "https://json.schemastore.org/claude-code-settings.json",
"model": "opus"
}
Local Project Settings (.claude/settings.local.json)
{
"model": "claude-opus-4-1-20250805"
}
Agent Definitions (.claude/agents/*.md)
All 15 custom agents have explicit model specification:
---
name: debugger
model: claude-opus-4-1-20250805
---
Steps to Reproduce
- Configure Claude Code with
"model": "opus"in global settings - Create local project settings with
"model": "claude-opus-4-1-20250805" - Create agent definitions with model specifications
- From main Claude Code session (running Opus 4.1), use Task tool to spawn a sub-agent:
````
Task tool -> subagent_type: "debugger" -> prompt: "What is your model?"
- Sub-agent reports: "I am Claude Sonnet 4 (claude-sonnet-4-20250514)"
Expected Behavior
Sub-agents should inherit the model configuration from:
- Parent session model (Opus 4.1)
- Or respect local/global settings configuration
- Or use agent-specific model configuration
Actual Behavior
All sub-agents default to Claude Sonnet 4 regardless of:
- Parent model being Opus 4.1
- Global settings specifying "opus"
- Local settings specifying "claude-opus-4-1-20250805"
- Agent definitions specifying the model
Impact
- Inconsistent model capabilities between parent and sub-agents
- Unable to leverage Opus 4.1's advanced capabilities in delegated tasks
- Configuration settings are effectively ignored for sub-agents
- Makes multi-agent workflows less effective
Attempted Workarounds
- ✅ Set global settings to "opus"
- ✅ Create comprehensive local settings with model specification
- ✅ Add model to each agent definition file
- ✅ Set CLAUDE_CONFIG_DIR environment variable
- ❌ None of these affect sub-agent model selection
Suggested Fix
The Task tool should:
- Check parent session model and use it for sub-agents by default
- Respect model configuration in settings files
- Allow explicit model parameter in Task tool invocation
- Document model inheritance behavior
Additional Context
This issue significantly impacts complex multi-agent workflows where consistent model capabilities are critical. In our case, we're running a production financial system that requires the most advanced model for all analytical tasks.
Verification Test
# Main session check
print(f"Parent model: {model_id}") # Returns: claude-opus-4-1-20250805
# Sub-agent check (via Task tool)
Task(subagent_type="debugger", prompt="Report your model ID")
# Returns: claude-sonnet-4-20250514
# Expected: Both should return claude-opus-4-1-20250805
---
Reported by: WNBA Betting System Team
Claude Code Version: 1.0.72
Priority: High - Blocks advanced multi-agent workflows
This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗