Part 1 · The Inner Loop

Agentic Workflows · ~7 min

Research, Plan, Implement

Plan-first was the reflex. This is the structure underneath it — three phases, a cost ladder that makes the ordering non-negotiable, and a way to spend reasoning where it actually pays.

Why this, for you: the same loop scales from a one-file change to a multi-session feature. Knowing which phase an error lives in tells you how much it costs to fix — and front-loading the reasoning where ambiguity is highest is a measured win, not folklore.

Agents that jump to implementation produce code that compiles but misses edge cases or duplicates utilities. Research-Plan-Implement separates information gathering from decision-making from execution — three phases, each producing the input to the next.

1 Three phases, one back-edge

Research builds a mental model: what exists (files, patterns, tests), what the constraints are, what's been tried (check git log). The goal is understanding, not output. Plan turns that into an approach you can review before paying for implementation. Implement executes with focused scope — deviations signal missing research, not creative latitude.

The loop has one legitimate back-edge: implementation surfacing new information that invalidates the plan is a deliberate replan gate — reassessment, not silent drift. Production agent work is described as exactly this: "plan, controlled execution, and replan gates."

2 Why the ordering is non-negotiable

The phases form a cost ladder. An error caught in research is a re-read; in planning, a rewritten paragraph; in implementation, a revert that burns the whole context window.

PhaseCost of an error caught here
ResearchRe-read a file (seconds)
PlanRewrite a paragraph (minutes)
ImplementRevert, re-plan, re-implement (burns context)
Addy Osmani reports successful agent-assisted developers spend roughly 70% of effort on problem definition and verification, 30% on execution — inverting the traditional ratio. The research phase prevents the single most expensive failure: implementing against wrong assumptions.

3 The reasoning sandwich

Don't spend reasoning uniformly. LangChain's harness-engineering research found that allocating maximum reasoning at planning and verification, lower during implementation, lifted benchmark scores to 66.5%. Implementation doesn't need creative problem-solving — it needs disciplined execution of a known approach.

# high reasoning → low → high RESEARCH + PLAN think hard: surface constraints, design the approach implement # mechanical execution of the plan VERIFY + FIX think hard: check against tests, repair

Investing extra compute in planning rounds on a mid-tier model can substitute for switching to a more expensive one — the gain comes from reasoning quality at the planning stage, not raw generation power. Sub-agents isolate phases too: research condensed to a ~1–2K-token summary keeps the implementer's context clean.

When research doesn't compound

The pattern assumes more reading yields a better plan. That breaks for well-mapped domains (the summary tells the implementer what it already knew), fast feedback loops (tests in seconds — try-and-fix converges faster than plan-and-verify), and open-ended exploration (a plan written before the shape is known ossifies premature structure). A stale research summary the implementer can't cheaply audit can seed a silent false assumption — worse than hitting the constraint directly.

The author reversed it — to QRSPI

Dexter Horthy, who popularised Research-Plan-Implement, publicly rebuilt it in early 2026 as QRSPI (Questioning, Research, Structure, Plan, Implement) after three failures at scale: a broad research prompt skipped the alignment moments where the agent should surface design decisions as options; the Structure step was the most-skipped in practice; and plans drifted silently once summaries lost fidelity. Treat the three phases as the minimum decomposition — add Questioning before Research and Structure before Implement for high-stakes work.

↪ Your win: phases, a cost ladder, and a reasoning budget

Retrieval practice — recall, don't peek

Question 1The three phases, in order, are…

Question 2An error caught during implementation rather than research costs you…

Question 3The reasoning sandwich allocates maximum reasoning to…

Question 4The pattern backfires when feedback loops are fast because…

Question 5 · spaced recall from Lesson 1Before the agent plans anything, the plan-first loop has it…

Ask me anything. Want the two-agent split (initializer + coding agent) that keeps research off the implementation budget, or where QRSPI's Structure step actually goes? Next in Part 1: Where You Stand — humans outside, in, or on the loop.
✎ Feedback