Free playbooks in your inbox
Cover of Claude Code Loops
From the youcanbuildthings catalog · ▸ Build-tested

Claude Code Loops

Stop Prompting, Start Shipping

eBook: $12.99 186 pages

You are the bottleneck. You prompt, you wait, you read the diff, you prompt again, and the agent stops the second you stop typing. This book hands you the fleet that ships without you. Your first loop runs on a real repository in Chapter 1, in ten minutes. By Chapter 4 you have built the same task four ways and priced each one, so you reach for the right loop instead of the loud one. By Chapter 6 a separate verifier signs off before code reaches your branch, and the working agent cannot talk its way past it. By Chapter 9 a night of agent work has a price you knew before you pressed enter. By Chapter 12 your loops run on a thirty-day schedule, wired so one loop's verified output becomes the next one's input.

Loop engineering is not a rebrand of the software development lifecycle. It is iterative development where the iteration is executed by something that cannot be trusted to report its own results, and that one difference changes every piece of the engineering around it.

This book refuses to print numbers it cannot verify. The four-bill comparison table in Chapter 4 ships blank on purpose, the rate sheet in Chapter 9 ships with underscores, and the most-quoted dollar-per-hour figure on the internet is named and then left unprinted. You fill those in from your own runs, because a printed rate is a wrong rate eventually.

Every loop, hook, gate, and receipt ships in a free companion GitHub repo: one folder per chapter, and one command that installs the whole set into a project you already own. Every command is tested on Linux, WSL, and macOS.

What You'll Build

01
The Loop That Stopped While You Read This

Run a complete loop on your own repository in ten minutes, with a hard cap and a dollar ceiling set before the first iteration.

02
The Ladder, and Where Each Rung Breaks

Measure which rung you are actually on from your own session transcripts, not your own opinion.

03
The Contract Comes Before the Loop

Write the four contract files your loop reads every iteration, then watch it refuse work outside the scope boundary.

04
Four Loops, One Task, Four Bills

Build the same task four ways and record iterations, wall clock, and dollars for each. The cost spread is the lesson.

05
Defining Done

Replace 'loop until done' with an exit condition a computer evaluates, plus four enforced invariants that halt a runaway.

06
Never Let It Grade Its Own Homework

Stand up a separate verifier that gates on evidence on disk, then make the working agent lie on purpose and watch it get refused.

07
Recovery Is the Job

Build the four-rung escalation ladder so a stuck run climbs instead of replaying the same prompt into the same context.

08
What Survives Between Iterations

Build the state store and harness, then measure re-fetched tokens before and after on your own run.

09
The Ceiling and the Receipt

Instrument the loop to meter itself, enforce a hard dollar ceiling that halts mid-run, and print a per-iteration receipt.

10
Loops That Pay for Themselves

Build a break-even model from your real rate and your metered cost, then reconcile it against one overnight run.

11
Every Way a Loop Fails

Ship loop-doctor: a diagnostic that reads a run's logs and names which failure mode fired and which guard would have caught it.

12
Fleets, Graphs, and the Next Thirty Days

Wire two loops into a dependency graph where the second refuses to start if the first fails its gate, then schedule the fleet.