[BUG] general-purpose agent sets model as 'sonnet' rather than 'inherit'
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
When claude code uses the Task tool to spawn a general purpose sub-agent that sub-agent does not inherit the model from the parent claude code session. This is unexpected (to me at least) and leads to a scenario where the user may explicitly select Opus for a hard problem and then find that it is delegating core parts of the task to Sonnet, which then fails on them.
Feel free to close this issue if this behaviour is by design. I just couldn't find a documented reason for it so I thought I'd raise the point.
One thing I should mention is that I am getting the model used in the sub-agent by asking Claude Code to spawn one and ask it what agent it is using. I am assuming this information is accurate.
What Should Happen?
When Claude Code spawns a general-purpose sub-agent it should inherit the model from the parent Claude Code session.
Error Messages/Logs
Steps to Reproduce
> spawn a general purpose task subagent using the inherit model and ask it to confirm what model it is using
● Task(Check agent model)
⎿ Done (0 tool uses · 12.9k tokens · 6.3s)
● The agent is using Claude Sonnet 4.5 (model ID: claude-sonnet-4-5-20250929), which is the default model for sub-agents, not my model.
I'm using Claude Opus 4.1 (model ID: claude-opus-4-1-20250805), so the agent did not inherit my model
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.0.5 (Claude Code)
Platform
Anthropic API
Operating System
Other Linux
Terminal/Shell
Other
Additional Information
_No response_
This issue has 5 comments on GitHub. Read the full discussion on GitHub ↗