[Feature] Ability for Claude Code to change used model by itself
I'd love to have ability for Claude Code to change used model by itself. I have a flow that contains planning phase and then execution phase and I'd like Claude to automatically switch to Opus for it, while for execution I'd switch back to Sonnet. For now I need to some ugly hacks to interrupt Claude flow to switch the model manually myself.
Yeah, that would be useful. Seems pretty easy to implement too – just need to add a ChangeModel tool to the existing embedded tools. If only Claude Code were open source... 🥲
Yeah, that would be useful. Seems pretty easy to implement too – just need to add a
ChangeModeltool to the existing embedded tools. If only Claude Code were open source... 🥲
That sounds interesting, I’ll give it a try!
I actually found a solution. It's one of the "if everything else failed, RTFM" because if you run claude code and do /release-notes and then scroll back to ancient times you find
Version 0.2.44:
• Ask Claude to make a plan with thinking mode: just say 'think' or 'think harder' or even 'ultrathink'
so I now run Sonnet as default model, but all my "recipes" do use think hard whenever I want Opus to be used for the task. Then it switches back and it works pretty reliable for me.
I actually found a solution. It's one of the "if everything else failed, RTFM" because if you run claude code and do
/release-notesand then scroll back to ancient times you findVersion 0.2.44: • Ask Claude to make a plan with thinking mode: just say 'think' or 'think harder' or even 'ultrathink'so I now run Sonnet as default model, but all my "recipes" do use
think hardwhenever I wantOpusto be used for the task. Then it switches back and it works pretty reliable for me.
think hard just activates Sonnet-4’s extended-thinking mode (Both Sonnet 4 and Opus have extended thinkg mode); it doesn’t auto-switch to Opus. You’d still need to pick Opus explicitly. Please correct me if I am wrong.
+1 it would be so useful
+2!!! please implement
+3 that would be extremely helpful.
+1
Should we mark it closed?
https://github.com/anthropics/claude-code/issues/4815
I would consider this resolved with yesterday's update to assign models to agents. Working great for me.
This feature was implemented in v1.0.77! Use /model and select "Opus for planning, Sonnet for execution".
This automatically:
- Uses Opus during plan mode for complex reasoning
- Switches to Sonnet for execution to optimize costs
You can also assign different models to subagents when using the Task tool, allowing planning agents to use Opus while execution agents use Sonnet.
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.