Boris Cherny no longer prompts Claude. He writes loops that do it for him. Addy Osmani codified the practice. A GitHub repo with 3,885 stars gives you the tools to start.


In November 2025, Boris Cherny uninstalled his IDE. He hadn't opened it in a month. Cherny — the creator and head of Claude Code at Anthropic — had already moved past the workflow that most developers were just beginning to adopt. By December, Claude Code had written every line across 259 pull requests in his repo. By March 2026, Claude Code was 100% written by Claude Code itself.

But the most revealing shift came in a recent interview, where Cherny described what his daily work looks like now:

"I don't prompt Claude anymore. I have loops that are running. They're the ones that are prompting Claude and figuring out what to do. My job is to write loops."

Peter Steinberger, independent developer, said it separately and first: "You shouldn't be prompting coding agents anymore. You should be designing loops that prompt your agents."

Addy Osmani — engineering leader at Google — heard both statements, connected them, and wrote the essay that gave the concept a name. He called it loop engineering.

What Loop Engineering Actually Is

Loop engineering is replacing yourself as the person who prompts the agent. You design the system that does it instead. A loop is a recursive goal: you define a purpose, and the AI iterates — with sub-agents, verification, and external state — until the goal is complete or the loop decides to hand off to you.

For two years, the way you got something out of a coding agent was straightforward: you wrote a good prompt, shared enough context, read what came back, and typed the next thing. The agent was a tool and you held it the entire time, one turn after the next. Loop engineering ends that. You build a small system that finds the work, hands it out, checks it, writes down what is done, and decides the next step. The system pokes the agents instead of you.

Osmani is explicit about the framing: loop engineering sits one floor above agent harness engineering (which is the environment a single agent runs inside). The harness runs on a timer, spawns helpers, and feeds itself. Osmani's essay was published June 8, 2026. O'Reilly republished it on June 22. The concept spread fast.

The Five Building Blocks (Plus Memory)

Osmani's essay gives the most useful inventory of what a loop actually needs: five building blocks plus one place to remember things. Both Claude Code and OpenAI's Codex app now ship all five natively.

1. Automations — The Heartbeat

Automations are what make a loop an actual loop, not a one-off run. In the Codex app, you create one in the Automations tab: pick the project, the prompt it will run, how often, and whether it runs on your local checkout or a background worktree. Runs that find something go to a Triage inbox. Runs that find nothing archive themselves. OpenAI uses them internally for daily issue triage, summarizing CI failures, writing commit briefings, and hunting bugs.

Claude Code reaches the same place through scheduling and hooks. You can run a prompt or command on an interval with /loop, schedule a cron task, fire shell commands at lifecycle points with hooks, or push the whole thing to GitHub Actions for persistence beyond your laptop session.

A second in-session primitive matters here: /goal keeps going until a condition you wrote is actually true. After every turn, a separate small model checks whether you are done — so the agent that wrote the code is not the one grading it. You give it something like "all tests in test/auth pass and lint is clean" and walk away. Codex has the same thing, also called /goal.

2. Worktrees — Parallel Without Chaos

The second you run more than one agent, file collisions become the failure mode. Two agents writing the same file is the same headache as two engineers committing to the same lines without talking. A git worktree fixes it: a separate working directory on its own branch sharing the same repo history. One agent's edits literally cannot touch the other's checkout.

Codex builds worktree support in — several threads hit the same repo at once without collision. Claude Code gives you the same isolation with git worktree, a --worktree flag to open a session in its own checkout, and an isolation: worktree setting on subagents so each helper gets a fresh checkout that cleans itself up afterward.

3. Skills — Stop Re-Explaining Your Project

A skill is how you stop re-explaining the same project context every session. Both Claude Code and Codex use the same format: a folder with a SKILL.md inside holding instructions and metadata, plus optional scripts, references, and assets. Codex runs a skill when you call it with $ or /skills, or implicitly when your task matches the skill description. Claude Code does the same.

Without skills, the loop re-derives your entire project from zero every cycle. With skills, it compounds. The skill is where intent stops costing you over and over — the conventions, the build steps, the "we don't do it like this because of that one incident" — written once where the agent reads it every run.

4. Plugins and Connectors — The Loop Touches Your Real Tools

A loop that can only see the filesystem is a tiny loop. Connectors — built on MCP (Model Context Protocol) — let the agent read your issue tracker, query a database, hit a staging API, drop a message in Slack. Both Codex and Claude Code speak MCP, so a connector written for one usually works in the other. Plugins bundle connectors and skills together so a teammate installs your setup in one go.

This is the difference between an agent that says "here is the fix" and a loop that opens the PR, links the Linear ticket, and pings the channel once CI is green — by itself.

5. Sub-Agents — Keep the Maker Away from the Checker

The most useful structural thing in a loop is splitting the one who writes from the one who checks. The model that wrote the code is too nice grading its own homework. A second agent with different instructions — and sometimes a different model — catches the stuff the first one talked itself into.

Codex spawns subagents on request, running them in parallel and folding results into one answer. You define agents as TOML files in .codex/agents/, each with a name, description, instructions, and optional model and reasoning effort. Claude Code does the same with subagents in .claude/agents/ and agent teams that pass work between them. The usual split: one agent explores, one implements, one verifies against the spec.

Subagents burn more tokens — each does its own model and tool work. Spend them where a second opinion is worth paying for. This is also what Claude Code's /goal does under the hood: a fresh model decides if the loop is done, not the one that did the work.

6. Memory / State — The Spine

The sixth thing, the one that sounds too simple to matter: a markdown file, or a Linear board, anything that lives outside the single conversation and holds what is done and what is next. The model forgets everything between runs, so the memory has to be on disk and not in the context. The agent forgets. The repo doesn't.

What a Loop Looks Like in Practice

Stick the pieces together and a single thread turns into a control panel. Here is one shape Osmani describes using:

  1. An automation runs every morning on the repo. Its prompt calls a triage skill that reads yesterday's CI failures, open issues, and recent commits. It writes findings into a markdown file or Linear board.
  2. For each finding worth doing, the thread opens an isolated worktree and sends a sub-agent to draft the fix.
  3. A second sub-agent reviews the draft against project skills and existing tests.
  4. Connectors let the loop open the PR and update the ticket.
  5. Anything the loop cannot handle lands in the triage inbox for a human.
  6. The state file remembers what got tried, what passed, what is still open. Tomorrow morning, the run picks up where today stopped.

You designed it one time. You did not prompt any of those steps.

The cobusgreyling/loop-engineering Repository

Cobus Greyling turned Osmani's conceptual framework into a practical, tool-aware reference repo. As of June 29, 2026, cobusgreyling/loop-engineering sits at 3,885 stars and 507 forks on GitHub. It includes clone-and-run starters for Grok, Claude Code, Codex, OpenClaw, and GitHub Actions, plus seven production patterns with an interactive picker.

Seven Patterns

Pattern Cadence Use Case
Daily Triage 1d–2h Surface issues, CI failures, commit briefings
PR Babysitter 5–15m Watch open PRs, flag problems
CI Sweeper 5–15m Auto-fix failing CI pipelines
Dependency Sweeper 6h–1d Patch security vulnerabilities
Changelog Drafter 1d or tag Auto-generate changelog entries
Post-Merge Cleanup 1d–6h Clean up branches, stale refs
Issue Triage 2h–1d Classify and prioritize new issues

Each pattern has a starter kit you can scaffold in seconds. The repo also includes a primitives matrix comparing Grok, Claude Code, and Codex side by side — so you can design a loop that works regardless of which tool you sit in.

Three CLI Tools

The repo ships three npm-published CLI tools. No clone required — they run via npx.

loop-init — Scaffolds loop engineering starters into your project by pattern and tool.

npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok
npx @cobusgreyling/loop-init . -p pr-babysitter -t claude
npx @cobusgreyling/loop-init . -p dependency-sweeper --dry-run

Every scaffold creates:

  • loop-budget.md — pattern-specific daily caps and kill switch
  • loop-run-log.md — append-only run history
  • A loop-budget skill — runtime budget guard at start/end of each run

Supports Grok (default), Claude, and Codex. Falls back to Grok starter paths when a per-tool variant isn't yet available.

loop-cost — Estimates daily token spend for loop engineering patterns by cadence and readiness level (L1–L3). Uses cost metadata from patterns/registry.yaml.

npx @cobusgreyling/loop-cost --pattern ci-sweeper --cadence 15m --level L2
npx @cobusgreyling/loop-cost --pattern daily-triage --level L1 --json
npx @cobusgreyling/loop-cost --list

Each estimate includes four scenarios: early-exit/no-op (empty watchlist, minimal tokens), full triage (every run does a full scan), action every run (implementer + verifier every time, worst case), and a realistic blend based on readiness level. This is the tool that tells you whether your loop is financially sustainable before you run it for a week.

loop-audit — Scores a project's Loop Readiness on a 0–100 scale and suggests next steps.

npx @cobusgreyling/loop-audit .
npx @cobusgreyling/loop-audit . --suggest
npx @cobusgreyling/loop-audit . --badge
npx @cobusgreyling/loop-audit . --json

The audit checks for 14 signals: state file, triage skill, verifier skill, LOOP.md/config, AGENTS.md/CLAUDE.md, safety docs, GitHub workflows, MCP/connectors, worktree evidence, patterns/registry.yaml, loop-budget.md, loop-run-log.md, LOOP.md budget section, and loopActivity (v1.4 — dynamic proof via timestamps, git commits, scheduled workflows, and run logs).

Readiness levels:

  • L0 — Draft: document intent
  • L1 — Report-only loops
  • L2 — Assisted auto-fix with verifier
  • L3 — Unattended-capable (with human gates)

L3 requires verifier + state + cost observability (budget + run log + LOOP.md budget) and proven loop activity — not just files on disk. Exit code 2 if score < 40, useful for CI gates.

The Quickstart Workflow

The intended onboarding is five minutes:

# 1. Scaffold a starter
npx @cobusgreyling/loop-init . --pattern daily-triage --tool grok

# 2. Estimate token spend
npx @cobusgreyling/loop-cost --pattern daily-triage --level L1

# 3. Audit readiness
npx @cobusgreyling/loop-audit . --suggest

# 4. Start report-only (Grok example)
/loop 1d Run loop-triage. Update STATE.md. No auto-fix in week one.

The phased rollout is explicit: L1 report → L2 assisted fixes → L3 unattended. You start by having the loop only report what it finds. You graduate to letting it fix things with a verifier watching. Only then do you consider walking away.

How This Changes Prompt Design

Loop engineering does not kill prompt engineering. It moves it.

The leverage point moves from crafting individual prompts to designing the control systems that orchestrate agents over time. The prompt still matters — but it lives inside a skill, called by an automation, checked by a sub-agent, remembered in a state file. The prompt is no longer the unit of work. The loop is.

This has several concrete implications:

Prompts become structured artifacts, not ephemeral messages. A skill is a prompt written once and read every run. It has metadata, a description for implicit invocation, optional scripts. You version it. You review it. You stop writing the same instructions from scratch every Tuesday.

Verification becomes architectural, not conversational. In the old workflow, you read the output and decided if it was good. In a loop, a sub-agent with different instructions — and possibly a different model — checks the work. The maker-checker split is not a nice-to-have. It is the only reason you can walk away.

Context lives on disk, not in your head. The state file is the spine. The agent forgets everything between runs. The repo doesn't. If the loop's memory is in the context window, it dies when the session ends. If it's in a markdown file, it survives.

Cost becomes a design constraint, not an afterthought. loop-cost exists because sub-agents and high-cadence runs can burn tokens faster than you expect. The CI Sweeper pattern at 15-minute cadence with L2 readiness is marked "Very high" token cost. You need to know that before you start, not when the bill arrives.

What Loops Still Do Not Do For You

Osmani is clear about three problems that get sharper as loops get better, not easier:

Verification is still on you. A loop running unattended is also a loop making mistakes unattended. The verifier sub-agent makes "done" mean something — but "done" is a claim, not a proof. Your job is to ship code you confirmed works.

Your understanding rots if you allow it. The faster the loop ships code you did not write, the bigger the gap between what exists and what you actually understand. Osmani calls this comprehension debt. A smooth loop makes it grow faster unless you read what the loop made.

Comfortable is dangerous. When the loop runs itself, it is tempting to stop having an opinion and just take whatever it gives back. Osmani calls this cognitive surrender. Designing the loop is the cure when you do it with judgment — and the disease when you don't.

The Timeline

The shift happened fast:

  • November 2025: Cherny uninstalled his IDE. He was running 5–10 Claude Code sessions in parallel with a few hundred agents.
  • December 2025: Claude Code wrote every line across 259 pull requests in Cherny's repo.
  • January 2026: Cherny posted a thread showing his actual Claude Code setup — surprisingly vanilla.
  • March 2026: Cherny confirmed Claude Code is now 100% written by Claude Code itself. The Pragmatic Engineer published a 97-minute interview with him.
  • June 8, 2026: Addy Osmani published "Loop Engineering" on his blog and Substack.
  • June 22, 2026: O'Reilly republished the essay.
  • June 29, 2026: cobusgreyling/loop-engineering sits at 3,885 stars with seven community PRs merged, three CLI tools on npm, and companion repos for goal engineering.

According to a SemiAnalysis report, 4% of all public GitHub commits are now made by Claude Code, with projections suggesting that could cross 20% by end of 2026. Loop engineering is the methodology for the developers producing those commits — the ones who stopped typing at the agent and started designing the system that does.

Getting Started

If you want to try loop engineering, the path is concrete:

  1. Read Osmani's essay. It is the canonical source.
  2. Run npx @cobusgreyling/loop-init . --pattern daily-triage --tool claude in your repo.
  3. Run npx @cobusgreyling/loop-cost --pattern daily-triage --level L1 to understand what it will cost.
  4. Run npx @cobusgreyling/loop-audit . --suggest to see what you are missing.
  5. Start with L1 — report only. No auto-fix in week one. Let the loop tell you what it found. Read the findings. Decide for yourself.
  6. Graduate to L2 when you trust the triage. Add a verifier sub-agent. Let the loop draft fixes, but review every one.
  7. L3 is a decision, not a graduation. Only you know if your project can survive unattended loops.

Cherny's job is to write loops. Osmani wrote the manual. Greyling built the starter kit. The pieces ship inside the products now — Claude Code, Codex, Grok all have automations, worktrees, skills, plugins, and sub-agents. The loop is there. The question is whether you design it or keep typing.


Sources: Addy Osmani — Loop Engineering, O'Reilly — Loop Engineering, cobusgreyling/loop-engineering, OfficeChai — Boris Cherny interview, The Pragmatic Engineer — Building Claude Code with Boris Cherny, WorkOS — Boris Cherny interview takeaways


Suggested title: Loop Engineering: Stop Prompting Agents — Design Loops That Prompt Them

Word count: ~2,400

Fact-check notes:

  • Boris Cherny IDE uninstall: confirmed via OfficeChai interview (November 2025). Source: officechai.com
  • 259 pull requests / Claude Code self-written: confirmed via OfficeChai, March 2026. Source: officechai.com
  • "I don't prompt Claude anymore" quote: confirmed via interview, reported by OfficeChai and TechTimes. Date: June 2026.
  • Peter Steinberger quote: confirmed via Osmani's essay and GitHub repo. Source: addyosmani.com, github.com/cobusgreyling
  • Addy Osmani essay publication: June 8, 2026 on Substack and blog. O'Reilly republication: June 22, 2026. Source: addyo.substack.com, oreilly.com
  • Repo star count: 3,885 as of June 29, 2026 (GitHub search result). The brief said 3,831; actual count at time of fetch was 3,885 — the repo is actively growing.
  • 4% of GitHub commits by Claude Code: attributed to SemiAnalysis report via OfficeChai.
  • CLI tool details (loop-audit, loop-init, loop-cost): confirmed via GitHub repo tool directories and npm package references.
  • Seven patterns confirmed via patterns/registry.yaml reference in repo.
  • Readiness levels L0–L3 confirmed via loop-audit documentation.
  • /goal primitive: confirmed in both Claude Code and Codex per Osmani's essay.