Loop engineering: from writing prompts to writing loops

The claim that the unit of work is shifting from the prompt to the loop — Cherny, Osmani and Guzman all saying a version of it — and why the interesting question is not how to keep an agent running but who decides what "done" means.

A framing note, sitting one level above the mechanics in Keeping an agent running: goals, loops, hooks and schedules. The claim: the thing a person writes is no longer the prompt, it's the loop that produces the prompts.

Three versions of it, collected in a Department of Product piece from 2026-07-21. Boris Cherny, who built Claude Code, describes having stopped prompting Claude directly — loops prompt Claude and work out what to do, and "My job is to write loops." Addy Osmani calls loop engineering a matter of replacing yourself as the person who prompts the agent. Katia Guzman, at OpenAI, frames it as a shift from prompting to goal setting: describe the situation and let the model figure out the approach. Different words, one move — the human steps back from the per-turn instruction.

Source caveat

The article is paywalled and the capture is a fragment: it stops partway into the /goal section, before any of the worked examples. What survived is the framing above and the taxonomy below. The promised inventory of 100+ commands and the practical playbook are not in the clip and are not represented here. Treat this page as the framing, not as the guide it was.

Slash commands as the surface

The article's one durable piece of structure is a three-way split of what a /command actually is:

  1. Built-in — ships with the tool, handles session mechanics.
  2. Custom — a markdown file you write that expands into a prompt when invoked.
  3. Connector-exposed — surfaced by a connected MCP server or plugin rather than defined locally.

Worth noting because this notebook already runs entirely on category two: /ingest, /oracle and /lint in .claude/commands/ are markdown files, and they are the operations of the LLM-wiki pattern made typeable. The observation that a command is just a prompt in a file is unremarkable until you notice it is the same bet as "what the agent can't see doesn't exist" — put the procedure in the repository and it applies every run.

Where the framing is right, and where it thins out

It is right that the mechanisms now exist and are cheap. /goal, /loop, Stop hooks and scheduled runs are all in the tool; none of them needs building. The "Ralph Wiggum" loop that both Anthropic and OpenAI point at (see Harness design: prior work still to read) was a community hack a year ago and is now a first-class feature. That part of the shift has genuinely happened.

Where it thins out is the implied conclusion — that writing the loop replaces the judgment work. It doesn't; it relocates it. A loop that runs unattended still needs someone to have decided what "done" means, in advance, precisely enough that a model can check it. The /goal documentation's own advice makes this concrete: one measurable end state, a stated check, the constraints that must not be violated. Writing that is the same skill as writing a rubric for an evaluator, which is where the actual work turned out to be in every harness in this cluster. The typing goes away. The specification doesn't.

A separate line of evidence says the same thing from the other end. Agentic Coding and Persistent Returns to Expertise (2026-06-16), cited in The harness is a skill issue, reports from usage data that people with no formal coding training direct agents through complex technical work successfully, and that what predicts success is domain understanding rather than coding skill — "how well a person understands the problem they're trying to solve". If the returns have moved to understanding and specifying the problem, then the skill the loop removes is the typing and the skill it concentrates is exactly the one this framing keeps waving past.

The article is honest about the boundary, at least: it says goals are for well-defined, verifiable tasks, and not for decisions needing human judgement or where the cost of being wrong is high. That is the right line, and it is also exactly the owner's open question — delegating tasks is easy, delegating decisions is the part that buys time and the part nobody has scoped. "Write loops" is advice about the easy half.

One turn further out

Karpathy's version of the claim predates the article by four months and goes a step past it. His formulation is remove yourself as the bottleneck — you cannot be there to prompt the next thing, so arrange it once and hit go (NoPriors, March 2026). The metric he holds himself to is token throughput: leftover subscription quota means he failed to get enough happening per token he typed.

Then he takes the recursion one level further than anyone else in this cluster. If the loop is a markdown file, the loop is tunable — "a research organization is a set of markdown files that describe all the roles and how the whole thing connects", and you can therefore hold a contest between hand-written specifications, see where the improvements came from, and have a model write a better one (Auto Research: taking the researcher out of the loop). First you stop writing the code, then the prompt, then the loop, then the thing that writes the loop.

Which makes the objection above sharper rather than weaker. Every level of that stack still bottoms out in something unoptimised deciding what "better" means. Karpathy's own constraint says so — if you can't evaluate it you can't automate it — and his one working demonstration is a training run with a validation loss, the friendliest metric that exists.

Open