Back to Blog
AIWorkflowSoftware Engineering

My Four-Model Workflow for Writing and Reviewing Code

Splitting planning, tickets, coding, and review across four models by cost tier

Every pull request I ship now passes through four different AI models before I touch it myself. Not one assistant doing everything, but four, each handling the one part of the job it's actually best suited for.

This isn't about chasing novelty. It came out of a specific bad afternoon, and it's stuck around because it consistently produces better code than any single-model approach I've tried.

Four-model workflow — Opus plans, Sonnet writes tickets, a cheap model codes, Sonnet reviews

The problem with one model doing everything

The obvious way to use AI for coding is to open a chat, describe what you want, and let the model write it. That works fine for small, well-scoped changes. It falls apart on anything with real architectural weight, because a single model is simultaneously trying to think strategically about the system, plan the implementation, write the code, and catch its own mistakes. Those are different modes of thinking, and asking one pass to do all of them means each one gets shortchanged.

The fix I landed on: split those modes into separate steps, and assign each step to the model that's the right cost and capability tier for that specific kind of work.

Step 1: Opus draws the map

I hand the expensive model the raw problem. Not an implementation request, an architecture request, in plan mode. Where does this change live in the system? What does it touch? What's the right sequence for the work?

The output isn't code. It's a breakdown into a sequence of discrete steps, ordered so that each one is buildable and testable on its own. This is the step where I spend the most on tokens and don't think twice about it, because a wrong decision here compounds through everything downstream. Fixing a bad architecture after three more models have built on top of it costs a lot more than getting it right the first time.

Step 2: Sonnet writes the tickets

A mid-tier model takes Opus's step list and turns each step into a full ticket: exact files to touch, inputs and outputs, edge cases, acceptance criteria. The bar I hold this to is that an AI agent with no other context should be able to pick up a single ticket and implement it correctly with zero back-and-forth.

This step matters more than it looks like it should. A vague plan handed to a cheap model produces vague, wrong code. A precise ticket handed to a cheap model produces precise, correct code. The intelligence needed to remove ambiguity from a plan is meaningfully less than the intelligence needed to create the plan in the first place, which is why this doesn't need the expensive model.

Step 3: The cheap model writes the code

Qwen 3.6 or DeepSeek 4 takes each ticket and implements it. This is by far the least expensive step per token, and it's fine, because by the time the ticket reaches this model, all the hard thinking already happened. It isn't inventing an approach. It's executing one that a smarter model already worked out in detail.

This is the step people are usually most skeptical of. The instinct is that if you're going to use a cheap model at all, you should at least have it doing something low-stakes. But the stakes were already handled upstream. What's left is translation from spec to syntax, which is exactly what cheaper models are good at.

Step 4: Sonnet reviews and fixes

The mid-tier model comes back in to read the diff against the original ticket. It flags anything that's wrong, missing, or diverges from the spec, and fixes the obvious issues directly rather than just reporting them.

This closes the loop. The same tier of model that wrote the precise instructions is now checking whether those instructions were followed, which it's well positioned to judge because it already knows exactly what correct looked like.

Why I stopped trying to shortcut this

I tried skipping steps once. Went straight from a rough idea to the cheap model writing code, on a Tuesday, because I was in a hurry and didn't feel like waiting for two extra model calls. I spent longer debugging its confused implementation, one built on an ambiguous prompt instead of a precise ticket, than the entire four-step process would have taken start to finish.

That was the moment the workflow stopped being an experiment and became the default.

The tradeoff

More tokens spent? Yes. Four model calls instead of one adds up.

Slower end to end? Also yes. There's real wall-clock time in each handoff.

More confidence in what ships? Absolutely. I'm not optimizing for the cheapest single run anymore. I'm optimizing for the pull request I don't have to reopen three days later because something in it was subtly wrong.

For small, low-stakes changes, one model in one pass is still the right call. This workflow is for anything where the cost of a wrong architectural decision or a misunderstood requirement is higher than the cost of four model calls. In my experience, that's most of the work that actually matters.