The AI Corner

The AI Corner

Stop prompting. Start writing loops

The Claude Code team just published how loops actually work. Here is the mental model free, and the 12 ready-to-run loop recipes that hand your busywork to an agent

Ruben Dominguez's avatar
Ruben Dominguez
Jul 07, 2026
∙ Paid

The head of Claude Code stopped prompting.

“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.”

That is Boris Cherny, and the numbers behind the shift are public now. Bun’s team used agent loops to rewrite roughly 750,000 lines from Zig to Rust in 11 days, with 99.8% of tests passing. Stripe compressed a migration inside a 50-million-line codebase into a single day. One dev shipped a $50K contract for $297 in tokens.

A loop is an agent repeating cycles of work until a stop condition is met. The skill is picking the right one, and the Claude Code team defines four:

Decision table of the four Claude Code loop types. Turn-based: you hand off the check, use when exploring or deciding, reach for custom verification skills. Goal-based: you hand off the stop condition, use when you know what done looks like, reach for /goal. Time-based: you hand off the trigger, use when work happens outside your project on a schedule, reach for /loop and /schedule. Proactive: you hand off the prompt, use when work is recurring and well-defined, reach for all of the above plus dynamic workflows.
The four Claude Code loops in one screen: each rung hands the agent one more piece of your job.

  1. Turn-based. You prompt, Claude works, you check. Every session you already run. You hand off the check by encoding verification as a skill.

    Diagram of the turn-based agentic loop in Claude Code. Your prompt flows into a cycle of gather context, take action, and verify the work, then exits to a response. The loop exits when Claude judges the task complete or the effort budget runs out.
    The loop you already run: prompt in, verify, respond. Encode the verification as a skill and the loop starts closing itself.

  1. Goal-based (/goal). You define done, and a second model judges every attempt to stop. You hand off the stop condition.

Diagram of the goal-based loop using the /goal command, with the example "/goal get the homepage Lighthouse score to 90 or above, stop after 5 tries." Claude works on the task and tries to stop, an evaluator model checks the condition, and the loop ends when the goal is met or the turn limit is reached. If the condition is unmet, Claude is sent back to work.
The /goal trick: the agent that works stays separate from the agent that decides it is done.

  1. Time-based (/loop, /schedule). The prompt reruns on an interval, locally or in the cloud. You hand off the trigger.

  2. Proactive. Schedule + goal + parallel workflows, running with zero humans in the loop. You hand off the prompt itself.

Diagram of a proactive loop in Claude Code that runs in the cloud with the laptop open or closed. A /schedule trigger watches Slack or GitHub for bug reports, a main agent loops until the verification skill passes as the goal check, it opens a PR, a second agent reviews and notifies you, and you decide what to merge.
The full proactive stack: /schedule triggers it, /goal keeps it honest, a second agent reviews, and your only job is the merge.

Read that list again as a ladder. Each rung hands the agent one more piece of your job, and most people stay parked on rung one.

That mental model is yours free. The gap between knowing it and running it is the exact commands, the verification skills, the stop conditions that resist gaming, and the cost guardrails, because the same primitives that shipped Bun’s rewrite have burned teams for $47,000 when left alone.

Behind the paywall:

 Cover graphic from the Claude Code guide titled "Getting started with loops: different types of loops in Claude Code and when to use them," showing a circular diagram of dashed boxes where a goal enters the loop, the agent cycles through repeated steps, and a stop condition decides when the loop ends.
A loop in one picture: a goal goes in, the agent cycles, and a stop condition decides when it ends.

▫️ The 12 loop recipes, exact copy-paste commands for engineering and non-engineering work

▫️ The /goal evaluator mechanic, why a second model judges “done” and how to write conditions it can verify

▫️ The verification skill template, the single change Boris says 2-3x’s output quality

▫️ The cost math, what a loop beat costs, the $1,000-a-month cadence trap, and the model-routing lever

▫️ The guardrail checklist, turn caps, circuit breakers, and the blowup stories behind each rule

▫️ The failure-mode file, reward hacking, agentic laziness, and the Dumb Zone

▫️ The decision table, which loop for which job, on one screen

▫️ The escalation path, from your first /goal to a proactive loop that runs while you sleep

One subscription unlocks every system

This is one build in a growing library. Premium opens all of them:

▫️ Loop engineering for coding agents

▫️ The Autoresearch Playbook

▫️ The Claude managed agents guide

Plus a fresh system every week. One loop that babysits your PRs for a month pays the subscription back in an afternoon.


🔁 The Loop Library

The 12 recipes, the evaluator mechanic, the verification template, the cost math, the guardrails, and the decision table, in one system.

Try premium free for 7 days. Or get 50% off this week only.

Get The Loop Library below 👇

Get 50% off forever

Keep reading with a 7-day free trial

Subscribe to The AI Corner to keep reading this post and get 7 days of free access to the full post archives.

Already a paid subscriber? Sign in
© 2026 The AI Corner · Privacy ∙ Terms ∙ Collection notice
Start your SubstackGet the app
Substack is the home for great culture