The Idea That’s Eating Coding-Agent Twitter

The line going around right now is some version of this:

“You shouldn’t be prompting coding agents anymore. You should be designing loops that prompt your agents.” — Peter Steinberger
“I don’t prompt Claude anymore. I have loops running that prompt Claude and figuring out what to do. My job is to write loops.” — Boris Cherny

Addy Osmani wrote the clearest unpacking of it under the name loop engineering: you stop being the person who types the next prompt, and you build a small system that finds the work, hands it out, checks it, writes down what’s done, and decides the next thing. The agent gets poked by your system instead of by you.

He’s right. The leverage point really has moved. And his anatomy of a loop is correct — five moving parts and a place to remember things:

  1. 1.

    Automations — a heartbeat that does discovery and triage on a schedule.

  2. 2.

    Worktrees — isolation so parallel agents don’t collide.

  3. 3.

    Skills — project knowledge written down so the agent stops guessing.

  4. 4.

    Plugins & connectors — the loop reaching into your real tools.

  5. 5.

    Sub-agents — the one who writes is not the one who checks.

  6. 6.

    Memory — a file, a board, something on disk that survives between runs.

I want to push on one thing, because it’s the thing that decides whether your loop compounds or quietly rots.

In every version of this argument I’ve read, memory is the sixth piece. The afterthought. “Sounds too dumb to matter,” as Osmani puts it — a markdown file, a Linear board, whatever. The five real pieces are the machinery; the memory is the sticky note taped to the side.

I think that’s backwards. The memory isn’t the sixth piece of the loop. It’s the thing the loop exists to produce. Get that one inversion right and the other five fall into place around it. Get it wrong and you’ve built a very fast machine for generating code nobody can defend.

That inversion is a whole pipeline. I wrote a mini-book about it. It’s called The Clarity Forge, and the rest of this article is the loop rebuilt around the part everyone treats as the footnote.


The Monday-Morning Failure That Loops Make Faster

Start where the pain is.

You opened Claude Code on Monday. You typed “add multi-tenancy to the billing service.” Eight hours later the agent had touched forty-three files, half the test suite was yellow, and you could not honestly tell your tech lead what was decided, by whom, or against which constraint. The code looked fine. The intent was gone.

Now automate that. Put it on a heartbeat. Let it run while you sleep.

A loop running unattended is also a loop making that exact mistake unattended — and faster, and on more files, and with no one in the chair to feel the moment the intent slipped away. Osmani names the three problems honestly at the end of his piece: verification is still on you, your comprehension rots faster, and the comfortable posture (just take whatever it gives back) is the dangerous one. He calls the last one cognitive surrender.

Here’s the part that doesn’t get said: those three problems are not side effects of looping. They’re what happens when the loop’s memory is an afterthought. A scratchpad that says “what’s done and what’s next” tells you the state of the work. It says nothing about why the work is shaped the way it is. So the loop ships decisions it never recorded, the why evaporates on every cycle, and your only defense is to read every diff yourself — which is the manual labor the loop was supposed to remove.

You can’t fix that with a better scheduler. You fix it by changing what the loop writes down.


The Forge Is a Loop — Engineered Around the Artifact

The Clarity Forge is a six-stage pipeline. Read it as a loop and the shape is familiar, but notice what’s load-bearing:

Bootstrap → Grill-Me → Grill-With-Docs → ADR Grill → Tailored Emission → Property Compile → Dispatch → Verify-or-Escalate → Archive.

Every stage produces a versionable artifact before any production code exists. The code is the last thing that happens, and it’s the most disposable thing that happens. The iron rule of the whole book:

The spec is the durable artifact. The code is the side effect.

That single sentence is the difference between a loop that accrues comprehension debt and a loop that pays it down. Let me map the forge onto Osmani’s five pieces, because the pieces are the same — it’s the center of gravity that moves.

1. The heartbeat — but it discovers specs, not just tasks

A generic loop’s automation wakes up, greps yesterday’s CI failures, and drafts fixes. Useful. But it triages code.

The forge’s heartbeat triages intent. Stage 1 — OpenSpec Bootstrap — takes a fuzzy seed (“I want passkey login”) and refuses to write a proposal by guessing. It makes the Architect model interview you first. The output isn’t a diff; it’s a scaffolded openspec/changes/<id>/ folder with a one-page proposal.md and a countable tasks.md.

You can absolutely put this on a schedule. /loop re-runs it on a cadence; /goal keeps it running until a verifiable condition holds — and crucially, a separate small model grades whether you’re done, so the agent that wrote the work isn’t the one that declares victory. That’s the same maker-≠-checker discipline, applied to the stop condition itself. Same primitive Osmani describes. The difference is what gets discovered: not “here’s a bug,” but “here’s a change, fully specified, with acceptance checks that read like a checklist instead of a wish.”

2. Isolation — the Architect/Contractor split is the worktree discipline

Worktrees stop two agents from writing the same file. Necessary, mechanical, solved.

The forge adds the isolation that actually matters: a split in who does what kind of thinking. A frontier Architect (Opus, GPT-5, Sonnet 4.6+) writes and grills the plan. A local open-weight Contractor (Gemma, Qwen) executes against it — one task at a time, handed only the minimum spec slice that task needs.

The rule is strict: if you ever want to hand the Contractor several tasks at once “because they’re related,” that’s not impatience — it’s a signal that the proposal under-specified their interface. You go back and tighten the spec. The boundary between agents isn’t a directory on disk; it’s a boundary in the spec, and the spec is where collisions get resolved before they ever reach a file.

3. Skills — the forge runs on four real ones, not a vibe

Osmani’s right that skills are how you stop re-explaining your project like a goldfish every session. The forge doesn’t theorize about this; it’s built on a specific, named set from Matt Pocock’s open skills pack:

  • grill-me (Stage 2) — descends a depth-first ambiguity tree through your proposal, asking every question a senior reviewer would. “What does ‘fast’ mean here? What’s the smallest input that should be rejected? What happens if two users do this at once?” Every load-bearing assumption comes out with a measurable acceptance check or gets listed as an explicit non-goal.

  • grill-with-docs (Stage 3) — reconciles your fresh, locally-consistent proposal against what the repo already says is true: project.md, the ADRs, the glossary. It catches the term you reinvented, the ADR-007 decision you silently contradicted, the invariant another module assumes that your change would break.

  • /diagnose and /verify — the bug-shaped on-ramp and the verification discipline for when the loop has to debug, not just build.

These aren’t decoration on the loop. They are the stages. The skill is the authoring format; a plugin is just how you ship it across repos — same as in any loop.

4. Connectors — the OpenSpec CLI is the loop’s hands

A loop that can only see the filesystem is a tiny loop. The forge’s connective tissue is OpenSpec itself — a directory convention and a CLI. openspec init scaffolds the substrate. openspec validate is permissive. openspec archive is strict. That validate-loose / archive-strict asymmetry is what lets the loop run freely while it explores and then refuse to commit anything with a dangling reference. The loop can act inside your real environment — open the change, fold the delta into the living spec, move the change folder to the archive — because the CLI gives it hands that respect a contract.

5. The maker/checker split — and the move that breaks self-deception

This is the structural heart of any good loop, and the forge takes it further than “spawn a second agent to review.”

The trap, named in the literature as the cycle of self-deception: when the same agent writes both the implementation and its tests, the tests inherit the implementation’s blind spots. A second reviewer agent helps, but it’s still grading prose with prose.

Stage 4½ — Property Compilation — breaks the cycle physically. Before the Contractor writes a line, the forge compiles one executable property test per THEN clause — fast-check, proptest, Hypothesis — each traceable back to its scenario ID. The property is the contract. The code is what gets sampled against it. The checker isn’t a more skeptical model; it’s a falsifiable fact that existed before the code did.

And Stage 6 — Verify-or-Escalate — applies the same discipline to failure. When a task fails verification, you do not retry the Contractor with more context. You escalate the spec, not the code. The Architect diagnoses whether the failure was spec ambiguity (most common), a missing ADR (second), or a genuine model limit (rare), and it returns an updated task spec — never a code patch. The maker and the checker never collapse into the same agent, because the checker speaks a different language: properties, not prose.


The Sixth Piece, Promoted to First: The Lattice

Now the inversion.

Every loop needs memory on disk, because the model has anterograde amnesia — close the window and it forgets you; it does not learn your repo by working in it. Everyone agrees on this. The disagreement is about what the memory holds.

A “what’s done / what’s next” file holds the state of the work. The forge holds the state of the world — on disk, as a first-class artifact, in a sibling of openspec/ at the repo root called the lattice (lat.md/).

The lattice holds the five things a task list structurally cannot:

Node typeWhat it capturesADRA durable architectural decisionVocabularyThe canonical definition of a domain term — “Order: a finalized basket with a non-mutable line-item list”InvariantA property true across capabilities — “totals are non-negative integers in the smallest currency unit”PatternAn accepted pattern and where it applies — “saga for cross-aggregate consistency in checkout”PrincipleA rule that constrains future decisions

And the edges are the point — five named predicates (supersedes, implies, constrains, defines, honors) that turn a flat pile of records into a navigable map. A scratchpad can’t say this pattern honors that ADR or this invariant is implied by that decision. The lattice can. That’s the difference between a loop that remembers what it typed and a loop that remembers what it meant.

Here’s the move that makes it self-maintaining — and this is the part that should make a loop-builder sit up. The lattice isn’t a wiki someone updates. It’s fed by the archive step of the pipeline the loop already runs. Every design.md carries a Lattice Footprint: which nodes this change honors, which it mints, which it touches. On openspec archive, three operations run — mint the new nodes, append to the affected ones (never edit their frozen bodies), and resolve every reference so a dangling link aborts the archive.

So the contradiction that a normal loop would happily ship at 3am — routing a feature through Workspace when an ADR eleven months ago put the tenant boundary at Account — doesn’t merge. It fails a lint. The memory isn’t a passive log the loop writes to and never reads. It’s an active constraint the loop has to satisfy to make progress. That is what “the agent forgets, the repo doesn’t” actually has to mean if it’s going to hold.


What This Buys You That a Faster Loop Doesn’t

Go back to Osmani’s three honest caveats — the things the loop still doesn’t do for you — and watch what happens when the memory is the lattice instead of a sticky note.

“Verification is still on you.” True, and it always will be. But the forge moves verification off your eyeballs and onto the artifacts. “Done” stops being a model’s claim and becomes a green property suite traceable to a scenario ID. You’re still the one who decides what should be true — but you decide it once, in the grill, and it gets enforced on every cycle instead of re-checked by you on every diff.

“Your comprehension rots.” This is the one the lattice is built to stop. Comprehension debt grows when code ships faster than understanding. The forge inverts the order of operations: understanding is manufactured first, in the spec and the lattice, and the code is the projection of it. You can’t out-run your own comprehension when comprehension is the input, not the casualty.

“Cognitive surrender is the comfortable posture.” Osmani’s sharpest line is that two people build the identical loop and get opposite results — one moves faster on work they understand deeply, the other avoids understanding the work at all, and the loop doesn’t know the difference. Correct. But an artifact-centric loop makes surrender expensive instead of free. You cannot skip the grill without leaving the ambiguity tree empty. You cannot mint a decision without writing its node. The forge doesn’t trust your discipline; it makes the disciplined path the only one that archives.

You can outsource the typing. You can’t outsource the understanding. The forge is the loop that holds that line for you instead of hoping you hold it yourself.


Run It Monday

This isn’t a manifesto. It’s a field guide, and the on-ramp is five moves:

  1. 1.

    npm install -g openspec

  2. 2.

    openspec init — scaffold openspec/, fill in project.md.

  3. 3.

    Pick a schema — intent-driven if behavior is part of the stakeholder contract, spec-driven-with-adr if specs stay engineer-facing.

  4. 4.

    Drop the glue prompts into a snippet manager. Paste, don’t retype.

  5. 5.

    Take one change you owe someone this week. Run Glue 1. Let the Architect interview you before it writes a single line.

That’s the loop. Six stages, two sub-stages, a handful of copy-paste prompts, and a substrate that maintains itself as a side effect of shipping. The tools will mutate — OpenSpec might be renamed by next quarter, the Contractor might be a 4B model that beats today’s 31B, the skills will drift. None of it changes the pipeline, because the pipeline isn’t the tools. It’s the smallest set of moves that converts fuzzy intent into executable, falsifiable spec without losing the intent on the way.

Build the loop. Everyone’s saying that now, and they’re right. Just build the one that writes down why — because that’s the piece that turns a fast machine into an engineering practice, and it’s the piece everyone keeps filing under “the sixth thing.”

Build it like someone who intends to stay the engineer.


The Book

The Clarity Forge: An OpenSpec × Grill Mini Book lays out the whole pipeline — the OpenSpec setup, the copy-paste glue prompts that connect each stage, the ADR grill that interrogates decisions before they freeze, the property compilation that makes specs falsifiable, and the bonus chapter that introduces the lattice as a first-class artifact: directory layout, cross-link protocol, archive integration, and the tooling you actually build (under 300 lines — lat lint, lat index, lat graph).

A weekend read. A Monday-morning toolkit. Worked example included.

It’s the companion to the longer The Clarity Engineer: Code Is the Side Effect, which names the underlying discipline — clarity trading, world models, intent documentation, agent identity, networked agentic organizations.

📖 The Clarity Forge — https://leanpub.com/clarityforge

on Leanpub. 📖 The Clarity Engineer: Code Is the Side Effect — on Leanpub · also on Amazon.

Stop designing loops that forget. Start building one that remembers why.


Volodymyr Pavlyshyn writes and builds at the intersection of agent orchestration, AI engineering discipline, and the durable artifacts that make software teams legible to themselves.

Originally published on Sovereign Agentic AI on Substack.