Writing

Which AI model should you use for coding? Use a team, not one model

5 min read

One model leads. Cheaper models do the work. A large grid circle labelled Opus, plans, linked to three small shapes labelled Haiku, searches; Sonnet, codes; and Codex, reviews.

I pay for a Claude plan and a Codex plan. Until recently I sent almost everything to the biggest model I had. Planning a feature, finding where a function is used, reading a long log to find one error. All of it went to Opus.

I kept getting close to my weekly limit before the week was over. So I looked at what I was actually asking for, and most of it was reading. The agent opened files, searched, and read output. Only a small part was the kind of thinking that needs a top model.

So I changed how I work. One strong model plans and reviews. Cheaper models do the searching and write the code. A model from another company checks the result. This post explains why that works and shows the exact files I use. You can copy them.

Most of the work is reading

Take a normal request: "add a retry to every call to the payment API". Inside the agent this turns into a dozen steps. It searches the codebase, opens the files it finds, reads them, plans the change, edits the files, runs the tests and reads the test output.

Planning the change and checking it at the end don't use many tokens. Reading uses most of them. A search that opens ten files can pull 40,000 tokens into the context to produce a one-line answer.

That is also where the price gap between models is biggest. Reading 40,000 tokens costs about 16 cents on Opus 5.5 and 0.4 cents on Haiku 5.5. If you do that thirty times a day, it ends up as most of your bill, or most of your usage cap if you are on a subscription.

What one work week costs for the same work

Set how much you do in a day:

Searches
Coding tasks
Plans and reviews
Everything on Opus$48.50 / week
Opus
Opus
Searches on Opus: $27.00Coding tasks on Opus: $16.50Plans and reviews on Opus: $5.00
Each task on the right model$13.93 / week
Sonnet
Opus
Searches on Haiku: $0.67Coding tasks on Sonnet: $8.25Plans and reviews on Opus: $5.00

Same work, $48.50 vs $13.93 a week. 71% less.

Two weekly bills for the same tasks. On the top bar, searches are most of the cost. Move them to Haiku and coding to Sonnet, and the bill drops while planning stays on Opus. I count a search as 40k tokens read and 1k written, a coding task as 25k and 6k, and a plan or review as 30k and 4k, at API list prices.

With the defaults above, sending each task to the right model costs about 70% less, and most of that saving comes from moving searches to Haiku. Planning still runs on Opus, so the decisions don't get any cheaper or worse.

One lead model and a few helpers

This setup is usually called the orchestrator and subagents pattern. One strong model, the lead, talks to you, makes the plan and reviews the work. When it needs something read or typed, it writes a short brief and gives it to a helper that runs on a cheaper model. The helper does the work in its own context window and sends back only the result.

LeadOpus 5.5Reads your request, writes the plan, sends briefs, reviews what comes back, decides.

BriefFind every place we call the payment API.

Returns12 call sites with file paths and line numbers

The lead plans and checks. Each helper gets a short brief, does the reading or typing in its own context, and sends back only the result. Click a helper to see an example brief.

The separate context window helps as much as the lower price. The helper reads forty thousand tokens of source files, and the lead only gets a paragraph back. So the lead's context fills up with the plan and the decisions instead of raw files, and it can work for longer before it starts to lose track. Anthropic's guide to context engineering explains why this matters. Every token in the context competes for the model's attention, so tokens spent on noise make it worse at the actual problem.

Using a model from a different company as one of the helpers adds something else. Models trained the same way tend to miss the same things. When I ask Codex to review a diff that Claude wrote, it often points out a problem that Claude didn't flag when it checked its own work. It doesn't catch everything, but it catches different things, and that is what you want from a second reviewer.

Which model for which job

This is how I split the work now.

JobModelWhy
Talking to me, planning, reviewing, decidingClaude Opus 5.5The best judgment I have access to. The price is fine because these tasks use few tokens.
Searching code, reading logs, summarising docsClaude Haiku 5.540 times cheaper than Opus on input. Finding things doesn't need deep reasoning.
Writing code from a planClaude Sonnet 5.51.9 points behind Opus on Terminal-Bench, at half the price.
A second review, long terminal tasksCodexTrained by a different company, so it misses different things. Codex CLI topped Terminal-Bench 2.1 in June.
A problem the lead keeps failing atClaude Fable 5.2It leads some coding leaderboards. I try it on that one task.

The benchmarks support this split. They also show something I didn't expect.

Terminal-Bench, official board after the November 9 re-grade
Claude Opus 5.5
Anthropic
65.8
Claude Sonnet 5.5
Anthropic
63.9
GPT-6.1 Sol
OpenAI, Codex default
60.9
GPT-6 Astra
OpenAI
60.3
Same test, same rules, different models. Sonnet 5.5 is 1.9 points behind Opus 5.5 and costs half as much. Source: Geotoolbox summary of the official board, November 2026.

On the official Terminal-Bench board, Sonnet 5.5 scores 63.9 and Opus 5.5 scores 65.8. When the lead has already checked the plan, a 1.9 point difference isn't worth paying twice as much.

The thing I didn't expect is in the second view. The same model, GPT-5.5, scored 83.4 when it ran inside Codex CLI and 76.4 inside a generic agent tool. The tool decides how the model reads files, runs commands and recovers from errors, and here that alone was worth 7 points. That is bigger than the gap between most of the top models. So if two people disagree about which model is better at coding, they may really be comparing the tools they use.

How to set it up

Add two helper files to .claude/agents/ in your project. The model line picks the model, and the description tells the lead when to use it.

---
name: searcher
description: Finds files, call sites and errors in logs. Use for any "where is" or "find all" question. Read-only.
model: haiku
tools: Read, Grep, Glob
---

Return file paths with line numbers and a one-line note for each hit. Never edit anything.
---
name: coder
description: Writes code from a plan the lead has already agreed. Not for deciding what to build.
model: sonnet
tools: Read, Edit, Write, Grep, Glob, Bash
---

Follow the plan exactly, keep the diff small, and run the tests for the files you changed.

Then add one line to your CLAUDE.md so the lead actually uses them:

Searching and reading logs go to `searcher`. Coding from an agreed plan goes to `coder`. Before calling a change done, ask Codex for a review.

For the review, Claude Code runs Codex as a normal shell command:

codex exec --sandbox read-only "Review the uncommitted diff. List real bugs first." < /dev/null

The rule I follow now is short. Opus plans and reviews, Haiku searches, Sonnet writes the code, and Codex checks it.