The idiot-proof, step-by-step version. No theory, no jargon: exactly what to say, in what order, with diagrams. Built on the documented methods of Andrej Karpathy, Boris Cherny (creator of Claude Code), Anthropic's engineering team, and Jarred Sumner.
One picture. Every autonomous loop, everywhere, is this exact machine. If you understand this diagram, you understand everything else in this manual.
"Don't tell it what to do. Give it success criteria and watch it go." Andrej Karpathy, January 2026, after going from 80% manual coding to 80% agent coding in a single month.
Why this machine wins: Boris Cherny, who created Claude Code, ships hundreds of pull requests a month and says plainly, "I don't prompt Claude anymore. I have loops prompting Claude. My job is to write loops." Anthropic's own team ships 90% of Claude Code's production code this way. Jarred Sumner used 64 of these machines at once to port 535,496 lines of code in 11 days. Same machine, different sizes.
Four steps, every time. You can do this in two sentences of talking. The words in the orange boxes are literally what you say.
What does the world look like when this is done? Not "work on the site." What specifically exists at the end?
One phrase that fences the work. This is what stops the agent from "improving" things you didn't ask about.
The single highest-impact habit in this manual. Give the finish line: a test that must pass, a screenshot that must match, a number that must be hit. Without it, "looks done" is the only stop signal, and that's how you get confident garbage.
A screenshot, the error text, a link, or the name of something to copy. Pointing at a reference beats three paragraphs of describing. "Do it like the pricing page" is a complete instruction.
Follow the arrows. Three questions, and you always land on exactly one phrase to say.
When something earns loop status (you've asked for it twice, or it has a date, a checklist, or a "check again later"), it gets built like this. Six steps, in this exact order. Skipping a step is how loops become runaways.
Before any work: what does one successful pass produce, and how is it proven? Anthropic's team writes done-criteria to a file before execution so the goal can't drift mid-run.
A time ("nightly at 2 AM"), an interval ("every 30 minutes"), or an event ("when a deploy finishes"). One trigger per loop.
Not "fix everything." One item, then stop. Small units mean every pass is reviewable and a bad pass costs you nothing.
A test suite, a build command, a browser screenshot check. This is the load-bearing part. Sumner's 11-day port worked because 1,380,000 pre-existing test assertions were the ground truth and the agents were forbidden from modifying them. The OpenAI Codex team does the same: commit the failing tests first, then the agent implements until green WITHOUT touching the tests.
A separate fresh brain reads the finish line and the evidence, and defaults to FAIL. Never let the worker declare its own victory: an agent grading itself will delete the failing test and call it done. Claude Code's own goal mode uses a separate judge model for exactly this reason.
Max attempts, max minutes, max dollars, whichever hits first. The cap is the primary safety mechanism, not the completion signal. With all six pieces in place, the loop runs unattended and you only ever see results.
The daily rhythm every documented top operator converged on. Your job stops being typing and becomes three short review windows.
"You can outsource your thinking, but you can't outsource your understanding." Andrej Karpathy, April 2026. You still own architecture, taste, and every merge. The agents own the typing.
Five layers of defense stand between an autonomous loop and anything irreversible. Each ring has to be passed before the next one even gets asked.
| Rail | What it does |
|---|---|
| The checker | Rule-based pass/fail (tests, build, screenshot) runs on every pass, no exceptions. |
| The judge | A separate fresh brain confirms "done" against the written finish line. Defaults to FAIL. |
| The caps | Max attempts, max minutes, max spend. Hit any cap, the loop stops and reports. |
| The watchdog | A meta-loop checks every loop daily: missed schedule or failed judge = alert. Silence counts as failure. |
| The approval queue | Anything irreversible waits for a human. Decisions batch to your phone. |
Three symptoms cover 90% of loop failures. Start at the top and follow the arrows.
| Symptom | Cause | Fix |
|---|---|---|
| Claims done, isn't done | No real finish line, or the worker graded itself | Tighten "done when" to things a machine can check. Confirm the judge is on. |
| Keeps failing the same way | The prompt is missing a guardrail | Add one numbered rule to the loop's prompt per failure. Tune it like a guitar; never rewrite it wholesale. |
| Rebuilds things that already exist | Fresh context can't see prior work | Add to the prompt: "search the codebase before assuming something is missing." |
| Runs forever, burns money | No caps | Caps are non-negotiable: attempts, minutes, dollars. The framework refuses capless loops. |
| Does extra work you didn't ask for | No constraints line | Add "only touching X" and "one unit per pass, stopping early is correct." |
| You corrected it twice, still wrong | Polluted context | Fresh session. Restate the brief with what you learned. Then "make that a rule." |