claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[Feature] Ability for Claude Code to change used model by itself

Open MarcinOrlowski opened this issue 6 months ago • 4 comments

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.

MarcinOrlowski avatar Jun 08 '25 11:06 MarcinOrlowski

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... 🥲

mateuszmazurek avatar Jun 08 '25 12:06 mateuszmazurek

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... 🥲

That sounds interesting, I’ll give it a try!

musistudio avatar Jun 09 '25 14:06 musistudio

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.

MarcinOrlowski avatar Jun 16 '25 22:06 MarcinOrlowski

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.

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.

larryyu1285 avatar Jun 18 '25 09:06 larryyu1285

+1 it would be so useful

lpalm avatar Jul 09 '25 12:07 lpalm

+2!!! please implement

deksden avatar Jul 13 '25 21:07 deksden

+3 that would be extremely helpful.

mmkhatib avatar Jul 19 '25 02:07 mmkhatib

+1

ugolafosse avatar Jul 26 '25 17:07 ugolafosse

Should we mark it closed?

https://github.com/anthropics/claude-code/issues/4815

deksden avatar Jul 31 '25 12:07 deksden

I would consider this resolved with yesterday's update to assign models to agents. Working great for me.

AlfredoDinunzioTR avatar Jul 31 '25 17:07 AlfredoDinunzioTR

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.

shawnm-anthropic avatar Aug 22 '25 20:08 shawnm-anthropic

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.

github-actions[bot] avatar Aug 30 '25 14:08 github-actions[bot]