prewalk: let cheap models inherit expensive thinking
a coding agent spends most of its budget reading, not writing. prewalk pays a frontier model to do the reading, then hands the warm context to a cheap model to finish the job.
run a coding agent on a real task and watch where the tokens actually go. very little of it is the diff. the bulk is orientation: listing directories, grepping for a symbol, opening five files to find the one that matters, re-reading a function to be sure it does what the name implies. the edit at the end is often a dozen lines.
that ratio is the whole opportunity. if reading is where the money goes, and thinking is what you are actually paying a frontier model for, then the interesting question is whether a cheaper model can skip the reading entirely — not by being told the answer, but by walking into a session where the reading has already happened.
that is prewalk.
the technique
the run starts on the expensive model, with an extra instruction it never shows the user: explore the codebase, form a plan, write the plan down as a todo list, and begin.
so it does. it reads the code, decides on an approach, records the steps, and makes the first edit.
that first valid edit is the signal. it means the model is no longer guessing — it has enough of the codebase in context to commit to a change. at that moment the run swaps to a cheap executor model, and the planning instruction is pruned out of the context before the handoff.
the executor wakes up mid-task. it sees a conversation in which it already explored the repository, already reasoned about the design, already wrote a plan, and already landed an edit. none of that reads as someone else's work, because the transcript is written in its own voice, in the first person, with no instruction sitting there explaining that the plan was requested. so it does the only sensible thing: it picks up the next item on the todo list and keeps going.
why it holds together
the executor inherits the two things that make the frontier model expensive — the loaded context and the committed plan — and pays for neither.
a cheap model dropped cold into the same task would spend its budget re-deriving orientation, and would do it worse. the failure mode of small models on long tasks is rarely that they cannot type the fix. it is that they wander: they open the wrong files, they re-plan halfway through, they lose the thread of what they were doing. a todo list they believe they authored is a strong anchor against exactly that.
pruning the planning instruction is not decoration. leave it in and the model can see that planning was assigned to it as a task, which invites it to treat planning as still open — to revisit the approach, second-guess the list, redo the exploration. remove it and there is nothing to reopen. the plan is simply a fact about what it decided.
the numbers
the original write-up reports a run scoring roughly 92% of frontier-model quality at 53% of the cost and about 1.5× the speed. the speed is not a rounding artifact — the executor never pays for the exploration phase, and exploration is the slow part.
the more interesting result is behavioral. models trained hard against public benchmarks have a habit of reaching for the web when they recognize a task, effectively looking up the answer instead of deriving it. under prewalk that rate drops sharply. a model that believes it has already read the code and already decided what to do has no reason to go looking for the answer somewhere else. it thinks it is midway through, and midway through is not when you start searching.
where it applies
this is not a coding-agent trick so much as a shape of task. it fits anything with a costly orientation phase and a cheaper mechanical tail:
- audit a repository, then apply the same finding across forty files
- read a long brief, then produce the twenty artifacts it implies
- diagnose a failure once, then fix each instance of it
the general rule: spend frontier tokens on the irreversible decision, and cheap tokens on everything downstream of it. prewalk is one clean way to draw that line — and to make sure the cheap half never notices it was drawn.
it also comes with the obvious caveat. the executor inherits a plan it cannot really re-litigate, which is precisely the point and precisely the risk. if the frontier model's plan is wrong, prewalk buys you a fast, cheap, confident march in the wrong direction. the swap should land after the first edit, not before — the edit is the evidence that the plan survived contact with the code.
source
the technique, the framing, and the benchmark numbers here come from stencil's write-up on prewalk: https://stencil.so/blog/prewalk — this is our reading of it, not their words. go read the original.