The disciplined compounding loop
How to run each agent task as plan, test-first build, check and retrospective, and why unstructured generation costs delivery stability.
Written by
-
Benedikt Stemmildt Founder & Co-CEO
Updated:
Agentic Engineering 5
Our position. When a run goes wrong, we do not fix its output. We change the skill or rule the agent acted on, so the next run does not repeat it. A harness does not remember what you tell it (opens in a new tab): each correction has to become a rule, a skill or a hook.
Most of the leverage sits before the build. A plan that a second pass has attacked, sliced into testable features, keeps the agent on scope, and every phase gets a small instruction budget.
How does a structured cycle make each change cheaper?
Raw generation is not the same as delivery. Google’s DORA 2024 report found that every 25% increase in AI adoption correlated with a 7.2% decrease in delivery stability, and GitClear’s analysis of 211 million lines found a tenfold rise in duplicated code blocks, with cloned code exceeding moved code for the first time; the output rose while the system got harder to maintain (A Plan-Do-Check-Act Framework for AI Code Generation (opens in a new tab), 20 October 2025). The response is to wrap the agent in a structured cycle. The article’s PDCA loop (working agreements, project-wide analysis, atomic test-driven implementation, a completion check, and a micro-retrospective) is sized to one-to-three-hour tasks and produces artifacts for tracking; in a head-to-head against unstructured work the unstructured run spent 80% of its tokens after the agent declared the task done, on troubleshooting, while PDCA shipped fewer production lines with more tests and earlier failure detection, and PDCA has independently cut defects 61% in a controlled study (A Plan-Do-Check-Act Framework for AI Code Generation (opens in a new tab), 20 October 2025).
Process rigor should scale with task criticality rather than apply uniformly, echoing the Crystal family of agile methods. The PDCVR variant extends the same skeleton with an explicit completeness check (a model will otherwise stop before finishing the plan) and a delegated verification agent (Plan-Do-Check-Verify-Retrospect (opens in a new tab), 3 January 2026).
A complementary framing treats the whole practice as a spectrum of feedback loops to tighten or loosen by task, and insists the loops be closed. The Elastic Loop framework arranges the options from tightest to loosest, autocomplete, a chain of small supervised steps, rapid prototyping, best-of-n (implementing one feature five to ten ways and picking the winner), deferred asynchronous prototyping, and ambient agents that watch domain events like a new issue or a folder of user interviews and act unprompted. In this frame AI is a commodity you pay for by volume, like electricity, but the returns require laying pipes (context and platform), and the metric that matters is not merge-request count but unclosed loops, the stale unmerged PRs and the sessions an exasperated user threw away.
The talk separates autonomy from agency, the capacity to actually use autonomy, noting that organizations granting large autonomy often see no one engage because people are not high-agency, and that expertise gets democratized while experience does not; its supporting evidence includes METR’s May 2025 finding that experienced open-source maintainers forecast a 24 percent speedup from AI tools but ran 19 percent slower, a Procter & Gamble study of about 760 people where one person with AI matched a two-person team without it while breaking down silos, and the METR trend that the task length a frontier model can handle doubles roughly every six to seven months (INNOQ – Agentic Engineering as Feedback Loops (opens in a new tab), 2 December 2025).
The planning half of the cycle carries most of the leverage, and it has its own discipline. The prompt itself is maybe 5% of what determines quality; the other 95%, architecture, conventions, plan, review criteria, is a system-design problem, not a prompt-engineering one (The Vibes Don’t Scale (opens in a new tab), 13 April 2026). A plan should be adversarially reviewed, a second pass hunting for missing edge cases and scope creep, before any code is written, which also controls scope: without a contract the agent solves adjacent problems it stumbles on, each defensible in isolation and collectively devastating (The Vibes Don’t Scale (opens in a new tab), 13 April 2026). Plans should be sliced vertically, one testable feature end to end, not horizontally (all the database, then all the services), which leaves thousands of untested lines and no checkpoint (RPI to CRISPY (opens in a new tab), 24 March 2026).
And the instruction budget is finite: frontier models reliably follow roughly 150 to 200 instructions, so a single mega-prompt stacked with a CLAUDE.md, tool docs, and MCP definitions will not get full adherence; split it into small phases of under forty instructions each, and use control flow (a classifier routing to focused prompts) rather than one branching prompt to do control flow (RPI to CRISPY (opens in a new tab), 24 March 2026).
The payoff of running a real cycle is compounding: each feature should make the next one cheaper. Roughly 80% of the work is planning and review and 20% is the build, and the discipline that compounds is capturing every lesson, a convention violation, a wrong turn, a decision the code cannot settle, as a durable rule or prompt that lives in the repository and arms the next run and the next hire (Compound Engineering (opens in a new tab), 11 December 2025). The distinction that keeps this honest, learned from 240 recorded planning trials, is what to write down: knowledge the model can derive from clean code (file locations, dominant patterns) belongs in the code, and a map of it only saves 10 to 20% of exploration; a decision the code cannot reveal (which of two live patterns is canonical, an in-progress migration, an abandoned experiment) must be written into the agent-facing guidance, where a single line flipped the agent’s choice every time against a fourteen-to-two majority; and genuinely open decisions belong in neither, they should surface in the plan for a human to settle (AGENTS.md: Write Down What the Code Can’t Say (opens in a new tab), 11 July 2026). Verify what the code can prove; write down what it cannot; ask about what is still open.
The same team later shipped the loop as machinery rather than intent, and the shipped shape adds two things the essay does not. Six named steps run in order, brainstorm the requirements, plan the implementation, work the plan, simplify what was written, review the result, compound the learning; the simplify step sits deliberately between writing and review, so the reviewer spends its attention on a tightened diff instead of on first-draft noise. And the return arrow is an artifact contract rather than a habit: the compound step writes each learning into a tracked folder that the next brainstorm and plan read back as grounding, alongside a standing strategy document and the prior plans, so the next run loads the lesson instead of someone remembering it. Skills sit around the loop for the inputs it does not fit, ideation for when there is not yet a feature to plan, a debug path that replaces brainstorm-plan-work when the input is a broken behaviour rather than a wanted one, and a windowed usage report that feeds observed production behaviour back into the next round of ideas (EveryInc - Compound Engineering plugin (opens in a new tab)).
A research-grade formalization of the same preparation-first bet names three phases that complete before any agent writes code: contextual grounding (externalizing domain expertise and tacit knowledge into markdown briefing documents), collaborative specification (human-agent dialogue that encodes value judgments, including what to exclude, as constraints), and task decomposition (converting the spec into dependency-aware task records that let multiple agents run in parallel without coordination overhead). In a competitive hackathon the approach spent roughly two hours preparing against about twenty-one minutes of active implementation per agent, a 5.7:1 preparation-to-execution ratio, and produced an 8,496-line full-stack application with near-zero architectural rework, the bugs that surfaced being integration and styling issues rather than misalignment (Mise en Place for Agentic Coding (opens in a new tab), 6 May 2026).
The paper names the underlying skill context fluency, the ability to create rich structured context agents can act on, and locates it upstream of prompting: decomposition, specifying the why and not only the what, constraint definition, and domain encoding of tacit knowledge the agent cannot generate itself. The single-case caveat is explicit (one hackathon, one practitioner, no control group), so the ratios are observations and not measured effects against a baseline.
Related
- The agent loop: the inner loop this cycle wraps.
- Human accountability: who decides what ships at the end of each cycle.
- Context as a versioned artifact: how captured lessons get owned and revised.
- Dark Factory Patterns: the codification step at factory scale.
- Quality and Verification: the checks that run inside the build phase.
Resources
Articles
- A Plan-Do-Check-Act Framework for AI Code Generation (opens in a new tab) - InfoQ article on a PDCA cycle for one-to-three-hour agent tasks, compared head to head against unstructured work.
- AGENTS.md: Write Down What the Code Can’t Say (opens in a new tab) - Blog post drawing on 240 planning trials to separate what agent guidance must state from what clean code already shows.
- Compound Engineering (opens in a new tab) - Every essay on making each feature cheaper than the last by turning every lesson into a durable repository rule.
- The Vibes Don’t Scale (opens in a new tab) - Blog post arguing that prompt quality is a system-design problem and plans need an adversarial review before any code.
- plan-do-check-verify-retrospect: A framework for AI Assisted Coding (opens in a new tab) - DEV post extending PDCA with an explicit completeness check and a delegated verification agent.
Papers and reports
- Mise en Place for Agentic Coding (opens in a new tab) - arXiv single-case paper on three preparation phases before agents write code, reporting a 5.7 to 1 preparation-to-execution ratio.
Posts
- A harness does not remember what you tell it (opens in a new tab) - LinkedIn post arguing that every correction of a bad run must become a rule, a skill or a hook.
Talks and videos
- Everything We Got Wrong About Research-Plan-Implement (opens in a new tab) - AAIF Live talk on vertical plan slicing and the finite instruction budget, about 150 to 200 instructions per model.
- The Elastic Loop: From Tool Thinking to Team Dynamics (opens in a new tab) - code.talks 2025 talk arranging agentic practice as feedback loops from autocomplete to ambient agents, measured by unclosed loops.
Tools and repositories
- EveryInc/compound-engineering-plugin (opens in a new tab) - EveryInc’s Claude Code plugin running the compound loop as six named steps that write each learning back, MIT licensed.