Topic 2 of 5 · 5 min read
Matching model and reasoning effort to the task
Goal: Assign a model and reasoning effort to each step of an agent workflow and justify the cost against the quality risk.
Use the cheapest model and the lowest reasoning effort that reliably does the step, and spend the strong model where a wrong answer is expensive. Model providers sell several tiers: a small fast model, a mid-size default and a large model. Price per token can differ by an order of magnitude between the smallest and the largest. Reasoning effort (sometimes called thinking budget) adds more output tokens on top.
Check yourself · 1 of 3
Which step is the best candidate for a small, fast model at low effort?
Why it matters
Running the largest model with maximum effort for everything is like sending a senior architect to rename a variable. The result is fine and the bill is not. Running the smallest model on a hard design problem fails the other way: you pay for three wrong attempts and your own time.
How to choose
- Break the workflow into steps. For example: find the code, plan the change, edit, run tests, review.
- Rate each step by the cost of being wrong. Searching a repo for a function name is cheap to get wrong, since you see it at once. A plan that touches ten files, or a security review, is expensive to get wrong.
- Assign by risk. Small fast model for search, summaries of files, boilerplate and mechanical edits. Mid-size model for most feature work. The strongest model, with higher effort, for planning, tricky debugging and final review.
- Use subagents or per-step settings. Many agents let a helper run on a smaller model so the main session stays on the strong one. Claude Code, for instance, lets you set the model and effort per session or per subagent.
- Test the choice. Run the same five tasks on two tiers and compare the cost, the retries and whether the change merged. Switch tiers only on evidence.
Before and after
Before: every step, including "list the files that import Cart", runs on the largest model at high effort.
After:
- Find usages: small model, low effort.
- Plan a refactor across modules: strong model, high effort.
- Apply the planned edits: mid-size model, default effort.
- Review the diff for security issues: strong model, high effort.
Same result on the risky steps, much lower cost on the routine ones.
What goes wrong
- Downgrading the review step. Savings on the step that catches mistakes get paid back as production bugs.
- Counting only price per token. A cheaper model that needs four tries can cost more than a stronger model that needs one.
- High effort by default. Extra reasoning on a simple edit adds output tokens, which are the expensive kind, and no accuracy.
- Switching models mid-session without checking the cache. A different model starts with an empty cache, so the first turns cost more.
Examples
A per-step assignment table
A team wrote down its refactor workflow and priced each step by risk:
- Locate usages: small model, low effort. A mistake is visible at once.
- Plan across modules: strong model, high effort. A wrong plan wastes every later step.
- Edit files from the plan: mid-size model, default effort.
- Security review of the diff: strong model, high effort. A miss ships.
Their cost fell on the routine steps and stayed flat on the two that protect quality.
Key points
- Assign models by the cost of a wrong answer: cheap and fast for search and mechanical edits, strong for planning and review.
- Reasoning effort adds output tokens, so raise it for hard problems and keep it low for routine ones.
- Compare total cost per merged change, including retries, not only the price per token.
- Use subagents or per-step settings so the strong model is not used for every small lookup.
- Test a tier change on a handful of real tasks before making it the default.
Common mistakes
- Using the strongest model and maximum effort for every step because it is easier than deciding.
- Choosing the smallest model for planning or review to save money, then paying for rework.
- Judging a model by price per token alone and ignoring retries and failed changes.
Check yourself · 2 of 3
An agent runs the strongest model on maximum effort to rename a variable in one file. What is the main cost problem?
Check yourself · 3 of 3
A cheaper model needs four attempts per task, while a stronger model needs one. How should you compare them?
Practice items, not counted towards your mastery.
Start here
- Manage costs effectively (Claude Code docs) (opens in a new tab)DocsFree
Vendor guidance on checking usage, trimming context, choosing models and setting team spend limits.
- Prompt caching (Claude docs) (opens in a new tab)DocsFree
How cache prefixes work, what invalidates them, and which usage fields report cache reads and writes.
- Monitoring usage (Claude Code docs) (opens in a new tab)DocsFree
The metrics and events an agent exports so a team can see tokens and cost per user and per model.
More for this topic
- Model configuration (Claude Code docs) (opens in a new tab)DocsFree
How to pick the model and reasoning effort per session or per subagent in a coding agent.
- Claude API pricing (opens in a new tab)DocsFree
Per-model token prices, including the separate rates for cache writes, cache reads and output.