brewedbits.dev

Personal blog with guides and news on selfhosting, Linux and AI, from the Netherlands

nextDash nextdash --aboutYour bookmarks. Your terminal. checks your links knows your Docker host one container, no cloudLive demo →nextdash.cc ↗

Tip: /model opusplan plans with Opus and codes with Sonnet

Claude
~/tips/tip-claude-opusplan-model

/model opusplan

Uses Opus while planning and switches to Sonnet when Claude Code starts the actual work.

The expensive model earns its price when the thinking is hard, and wastes it typing out a for loop.

opusplan is a model alias that switches by mode. In plan mode Claude Code uses opus, and when you move to execution it switches to sonnet.

/model opusplan

Or start that way with claude --model opusplan. Combine it with Shift+Tab to plan mode and you get the stronger model for the design and the cheaper one for the typing, without touching a picker in between.

If you want the big context window for both phases, there is opusplan[1m]. Setting that with /model needs v2.1.265 or later, and older versions can use the --model flag or the model setting.

It reflects how coding work tends to split: a small amount of difficult decisions, then a large amount of plain edits. Planning is where a wrong choice is expensive, so spending more there makes sense, while implementing an agreed plan is something a faster model does well. I would try it for a feature that touches several files before I commit to anything else.

A detail on persistence: /model saves your choice as the default for new sessions, but --model and ANTHROPIC_MODEL only apply to the session you start.

Further reading: Model configuration – Claude Code docs, On this site: /statusline builds you a status bar with context usage in it, On this site: /branch lets you try another direction without losing this conversation

More Claude tips /recap /focus /skill-doctor /autocompact 500k claude purge ~/work/my-repo --dry-run All Claude tips (83) All topics

Link