Model division strategy: Opus plans, Sonnet builds (a real example from making this site)
- You don’t need the biggest model for every job. If you split the work, Opus for the hard judgment calls (planning and review) and Sonnet for the bulk of the work (implementation), you save cost and usage.
- The easiest way is
/model opusplan. It switches automatically: Opus in plan mode, Sonnet during execution. - A subagent’s model is decided by a fixed four-step order. If you switch to Opus with
/model, subagents that inherit the model also become Opus. - On the API, Sonnet 5.5 costs half as much as Opus 5.5 (as of 2026-11-16, see the table below).
- This site was built exactly this way. Check the case study below and the spec template you can follow along with.
What you’ll be able to do after this tutorial
Section titled “What you’ll be able to do after this tutorial”- Build a “big model plans, smaller model executes” setup with
opusplanand subagent settings. - Predict which model a subagent will run on by following the resolution order.
- Understand, in numbers, how model choice affects cost and usage.
- Use this site’s build as a reference to write a task spec for your own project.
Concepts to know first
Section titled “Concepts to know first”| Term | Meaning |
|---|---|
| opusplan | A special model alias that uses opus in plan mode and sonnet during execution. |
| Subagent | A helper agent with its own context. You can set its model with model in its definition file. (C14) |
| Inherit | A subagent using the same model as the main conversation. |
| effort | The level that sets how deeply the model thinks (low, medium, high, xhigh, max). |
| orchestrator / worker | A model-combination pattern from the official docs. It refers to a structure that delegates bulk work to a lower-cost model (the worker). |
Model choice according to the official guide (as of 2026-11-16)
Section titled “Model choice according to the official guide (as of 2026-11-16)”| What you need | Recommended model |
|---|---|
| Top performance (agent sessions that run for hours, multi-step deep research) | Fable 5.2 |
| Complex agentic coding, enterprise work | Opus 5.5 |
| Speed and performance for everyday coding and agent work | Sonnet 5.5 |
| Lowest latency and lowest price (real time, high volume, subagent tasks) | Haiku 5.5 |
The official docs say to “start with Opus 5.5 for most workloads.” They also say that adjusting effort is often a better lever than switching models. There are two starting strategies. If you prioritize efficiency, start with Haiku 5.5 and move up when it falls short. If you prioritize performance, start with Opus 5.5 and optimize by lowering effort or dropping to a smaller model.
Price differences (API, per 1M tokens, input/output, as of 2026-11-16)
Section titled “Price differences (API, per 1M tokens, input/output, as of 2026-11-16)”| Model | Input / Output |
|---|---|
| Fable 5.2 | $8 / $40 |
| Opus 5.5 | $4 / $20 |
| Sonnet 5.5 | $2 / $10 |
| Haiku 5.5 | from $0.10 / from $0.50 |
Sonnet costs half as much as Opus, and Fable costs twice as much as Opus. Subscription usage also varies with conversation length, features, model, and effort. See C2. Plans and usage limits for how limits are structured, C1 for model comparisons, and C16 for API prices.
The Claude Code cost guide recommends: “Sonnet handles most coding tasks well and costs less than Opus. Save Opus for complex architectural decisions or multi-step reasoning.” For simple subagents, it suggests model: haiku.
Step by step
Section titled “Step by step”-
The easiest division of labor: opusplan
Type it in a Claude Code session, or pass it with
--modelat startup. You can also putopusplanin themodelfield of your settings file./model opusplanTerminal window claude --model opusplanNow in plan mode (
/plan) Opus designs, and after you approve, Sonnet writes the code in the implementation phase. If you need a 1M-token context in both phases, useopusplan[1m]. Setting it through/modelrequires Claude Code v2.1.265 or later. On earlier versions, use the--modelflag or themodelsetting. -
Set a model for each subagent
Put
modelin the frontmatter of the definition file. Usehaikufor light work like search and log analysis, andsonnetfor reviews.---name: code-reviewerdescription: Reviews code for quality and best practicestools: Read, Glob, Grepmodel: sonnet---You are a code reviewer. When invoked, analyze the code and providespecific, actionable feedback on quality, security, and best practices. -
Learn the subagent model resolution order
Claude Code decides a subagent’s model in this order.
- The
modelparameter specified when it’s invoked - The
modelfrontmatter in the subagent definition (ifinherit, the main conversation’s model) - The
CLAUDE_CODE_SUBAGENT_MODELenvironment variable (when set to a model alias or ID) - The main conversation’s model
- The
-
One model for all subagents (optional)
You can set it for everything with an environment variable in your settings file. Setting
FORCEto1takes priority over models specified in definitions or at invocation, and applies to every subagent.CLAUDE_CODE_SUBAGENT_MODEL_FORCErequires Claude Code v2.1.257 or later.{"env": {"CLAUDE_CODE_SUBAGENT_MODEL": "haiku","CLAUDE_CODE_SUBAGENT_MODEL_FORCE": "1"}}Setting only
CLAUDE_CODE_SUBAGENT_MODELdoes not change the model of the built-in Explore and Plan subagents. You can see the model of a running subagent with/tasks.One model for workflow agents only: Dynamic workflows (scripts that run dozens to hundreds of agents) can get very expensive because there are so many agents. If you set
CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL, all workflow agents run on that model, while other subagents keep their own models (v2.1.296 or later).{"env": {"CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL": "sonnet"}}This example assumes the value format (alias or model ID) is the same as
CLAUDE_CODE_SUBAGENT_MODEL. The official environment variable docs don’t describe this variable yet, so we only confirmed the description in the changelog (CHANGELOG). -
Ask a higher model only at the hard moments:
/advisor(optional)You keep the main model fast, and only get advice from a stronger model before planning, when the same error keeps repeating, or before declaring the work done. The advice comes from an advisor tool running on Anthropic’s servers, and Claude decides when to call it.
/advisor opus- Typing just
/advisoropens a picker, and/advisor offturns it off. The model you pick is saved in theadvisorModelsetting. To use it for this session only, start withclaude --advisor opus. - The advisor model must be the same tier as the main model or higher. For example, with a Sonnet 5.5 main model you can use Fable, Opus 5 or later, or Sonnet 5.5.
- It’s an experimental feature and works on the Anthropic API, and also on Claude Platform on AWS and Claude Models on Google Cloud (Anthropic managed) with Claude Code v2.1.300 or later (not on Amazon Bedrock, Google Cloud’s Agent Platform, or Microsoft Foundry; as of 2026-11-16). A Fable 5.2 main model accepts only Fable 5.2 as its advisor. Advisor calls are billed at the advisor model’s rate and count toward your limits on subscription plans. Unlike
/modeloropusplan, which swap the whole model, this is used only at decision moments, so the official docs say it usually costs less than running a strong model throughout.
- Typing just
-
Check your usage
/usageshows where usage goes by skill, subagent, and MCP. When using agent teams, we recommend Sonnet for teammates and keeping the team small. Plan-mode teammates reportedly use about 7 times the tokens of a standard session.Screen guide: Checking where usage goes on the /usage screenSee this screen in the official help ↗
-
How was this site built? A real case study
Read the case below, then use the template in step 8 to write a spec for your own project. (The case is an honest account of how this site was built.)
Setup. In a single cloud session, Opus 5.5 handled planning, and Sonnet 5.5 subagents did the implementation. The subagent’s model was set with the
modelparameter of the Agent tool. That’s number 1 in the resolution order above.What Opus did.
- Clarified requirements by asking questions.
- Wrote
docs/PLAN.md. - Wrote a task spec for each step. (Per-step spec files such as
docs/specs/step1-skeleton.mdandstep2-samples.md) - Launched the subagents.
- Reviewed the results. Checked screenshots and verified facts.
- Made small fixes itself.
- Committed and opened PRs.
What Sonnet did.
Step Work assigned Step 1 Site implementation and official-docs research, run in parallel by two agents Step 2 Wrote the template and 2 samples Step 3 4 agents split up and wrote 14 Claude tutorials Step 4 4 agents each handled both research and writing for a topic area, producing 20 tutorials Steps 5-6 3-4 agents checked against the official sources, corrected facts, and filled gaps Step 7 1 site-structure agent, 3 product-specific agents, and 1 comparison/safety agent wrote 5 “Personal AI agents” tutorials (the comparison one ran after the product ones finished) Step 8 1 structure agent and 5 writers wrote 10 “Deep dive for developers” tutorials. Example code went through syntax and type checks Step 9 4 reviewers split up the sections and checked 51 tutorials for consistency (numbers, terms, links, tone, screens) What the review actually caught.
- A bug where the home title appeared twice. The cause was the condition that checks the home page id.
- A gap between research findings and the real screen. A research agent concluded “there are no cloud session credits,” but the actual settings screen showed that item. We recorded this as an “item not yet reflected in the official docs.” (You can see it in C2.)
- A gap between search summaries and the original text. At first, one tutorial was written from search summaries because the official site was unreachable. When checked against the originals, important facts such as supported languages and commercial-use terms by plan were sometimes wrong. So until they were verified against the original, we kept a “being verified” notice on them.
- Facts that diverged between subagents. One tutorial said “Sonnet 5.5 also blocks
tool_choiceany/tool,” but the reference tutorial (C16) table didn’t list it. When the planner checked the official release notes directly, that tutorial turned out to be right, and we added Sonnet 5.5 to the reference table. Conversely, the same subagent also added “Sonnet 5.5 also blocks sampling parameters,” which was about earlier-generation models, so we corrected it.
Lessons.
- The more concrete the spec, the better the subagent’s results.
- The planning model handles fact-checking and final judgment. When subagents disagree, settle it with the official source, not by majority vote.
- Have subagents not commit; collect and commit on the planner side to avoid conflicts.
- Order dependent tasks. For example, run the comparison tutorial after the product tutorials finish. Run independent tasks in parallel.
- Split editable files so they don’t overlap among parallel subagents.
-
Write your own task spec
Here’s a spec template that reflects those lessons. Swap the parts in parentheses for your own project, and either have an Opus planning session write the subagent spec file or fill it in yourself.
Task spec template (copy and fill in)Task spec: (task name)
Read first
- (Reference file paths: plan, template, finished sample)
Goal
- (What should be true when done, outcome-focused, within 3 lines)
Scope
- Files you may edit: (list of file paths)
- Files you must not touch: (everything else)
Rules
- Only write facts that are in (source file). Don’t assert anything unconfirmed; mark it “needs verification.”
- Do not git commit or push.
Definition of done
- (e.g., the build and tests pass)
Report format
- List of files written or changed
- Anything added beyond the source files, and its source
- Parts where you avoided asserting because you couldn’t confirm
- Build and test results
After handing off the spec, don’t just trust the result. Have the planning side verify the facts and open and check things directly.
Quick reference
Section titled “Quick reference”| What you want to do | How |
|---|---|
| Opus plans, Sonnet executes | /model opusplan or claude --model opusplan |
| Pin the model for one subagent | model: sonnet etc. in the definition file |
| One model for all subagents | CLAUDE_CODE_SUBAGENT_MODEL + CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1 |
| One model for workflow agents only | CLAUDE_CODE_WORKFLOW_SUBAGENT_MODEL (v2.1.296 or later) |
| Get advice from a strong model only at hard moments | /advisor opus, claude --advisor opus |
| Stop subagents from inheriting a big model | Switch models before delegating, or set model in the definition |
| Check a running subagent’s model | /tasks |
| See where usage goes | /usage |
| Make the Explore subagent lighter | Override it by defining a user subagent named Explore with model: haiku |
The built-in Explore subagent runs on the main conversation’s model by default. Only when the main conversation is Fable does it depend on how you’re connected: with a subscription, Console, or an ANTHROPIC_BASE_URL gateway it runs on the opus alias model, while on Bedrock, Google Cloud, Foundry, and similar it runs on the main model as is (as of 2026-10-12).
Common sticking points
Section titled “Common sticking points”My light subagent uses a lot of usage
Section titled “My light subagent uses a lot of usage”- Cause: A subagent that inherits the model may be running on the main conversation’s big model (for example, Opus).
- Fix: Set
model: haikuorsonnetexplicitly in the definition, and check the actual model with/tasks. The built-in Explore needs separate setup.
I set CLAUDE_CODE_SUBAGENT_MODEL but it isn’t applied
Section titled “I set CLAUDE_CODE_SUBAGENT_MODEL but it isn’t applied”- Cause: This variable acts as a default, so the model specified at invocation or in the definition’s
modeltakes priority. It doesn’t affect the built-in Explore and Plan. - Fix: To force it everywhere, also set
CLAUDE_CODE_SUBAGENT_MODEL_FORCE=1(v2.1.257 or later).
I see a per-model limit message like “Opus limit”
Section titled “I see a per-model limit message like “Opus limit””- Cause: You’ve hit the limit for a particular model family.
- Fix: Switch to a different model family with
/modeland you can continue the work. Note that session and weekly limits are shared across all models, so switching models doesn’t restore them.
Subagents are editing the same files
Section titled “Subagents are editing the same files”- Cause: The specs may have overlapping scopes, or each agent may have committed on its own.
- Fix: In the spec, list “files you may edit” separately for each agent, and have only the planner side commit.
Practical tips
Section titled “Practical tips”- Try effort before switching models. The official guide says adjusting effort is often better than swapping models.
- Opus for judgment, Sonnet for repetition. Opus fits architecture decisions and final review, and Sonnet fits implementation with a clear spec.
- Make specs concrete. The more you write file paths, editable scope, done criteria, and report format, the better the results.
- Have the planning model do the review itself. On this site too, fact-checking and screen checks caught real bugs and errors.
- Parallelize early. Split work that doesn’t share files across agents and run them at the same time. Just keep in mind that parallel runs use that much more usage.
- Average enterprise cost figures are in the official cost guide (about $13 per developer per active day, $150-250 per month, and 90% of users under $30 per active day). Your own usage may differ.
What to read next
Section titled “What to read next”- C14. Claude Code core features — subagent definitions and plan mode
- C13. Cloud sessions — the environment this site was built in
- C16. Getting started with the Claude API — model IDs and prices
- C1. Claude at a glance — comparing the 4 models
- Cut API costs with prompt caching, batching, and effort — other ways to reduce cost on the API
Sources
Last verified: Nov 16, 2026
- Claude pricing claude.com
- Model configuration (Claude Code) code.claude.com
- Choosing the right model platform.claude.com
- Manage costs effectively (Claude Code) code.claude.com
- Custom subagents code.claude.com
- Models overview platform.claude.com
- Escalate hard decisions with the advisor tool (Claude Code) code.claude.com
- Commands (Claude Code) code.claude.com
- Orchestrate subagents at scale with dynamic workflows code.claude.com
- Claude Code CHANGELOG (v2.1.296) raw.githubusercontent.com
- How do usage and length limits work? support.claude.com
Prices, limits, and menu names change often. Before making an important decision, check the official pages above for the latest details.
Finished this tutorial?
Progress is saved only in this browser and never sent anywhere.