Claude

The Claude loopsetup

Stop prompting, start writing loops. The 3 parts of a loop, the rule that makes or breaks it, and examples you can copy straight in. No coding needed.

  • ToolClaude
  • Time5 min
  • You needClaude (Claude Code for /goal)
  • Reel keywordLOOP

The guy who runs Claude Code at Anthropic, Boris Cherny, said he doesn’t prompt Claude anymore. His whole job now is writing loops.

This is what a loop actually is, how to build one, and the part that makes or breaks it. Plus 2 examples you can copy straight in. No coding needed.

What a loop actually is

Normal prompting: you ask Claude for something, it hands you an answer and stops. Good or bad, you’re the one who has to check it, then ask again.

A loop is different. You give it a goal. So Claude doesn’t stop when it produces something. It stops when it hits the goal. It checks its own work, and if it’s not there yet, it has another go, over and over, until it passes the bar you set.

The setup: 3 parts

Every loop is the same 3 pieces.

  1. The task. What you want done. “Write the one-page brief.”
  2. The goal. The finish line, written so Claude can check it. This is the part that turns a normal prompt into a loop.
  3. The self-check. Tell it to grade its own work against the goal before it stops, and to keep fixing until it passes.

The rule that makes or breaks it

Your goal needs a number or a checklist. Something Claude can actually grade itself against.

“Make it good” doesn’t work, because there’s nothing to measure. “Every claim has 3 sources and every link opens a real article” works, because Claude can go and check it.

Give it a vague goal and one of two things happens. It loops forever burning tokens, or it quits early and tells you it’s done when it isn’t. Give it a measurable goal and it knows exactly when to stop.

Two ways to run it

In a normal Claude chat or project. Build the goal and the self-check straight into your prompt. You still kick it off, but the checking is on Claude. Example 1 below is this one.

In Claude Code. There’s a built-in /goal command. You type /goal then your condition, and Claude keeps working turn after turn, with a small fast model checking the condition after each turn, until it’s met. You don’t prompt each step. Example 2 below is this one.

Examples you can steal

Paste this into a normal Claude chat:

Write me a one-page brief on [topic].

The goal, and don't stop until all of it is true:
- Every claim has at least 3 sources
- Every link opens a real, live article that actually backs the claim
- No link 404s or points to the wrong page

Before you finish, open each link yourself and confirm it is real and on topic. If any link is dead or doesn't back the claim, replace it and check again. Only stop once all 3 conditions pass.

Why it works: without the loop, this is exactly where AI hallucinates dead links. With the loop, Claude opens each one and confirms it’s real before it stops.

You’ll know it worked when every link in the brief opens a live page that backs the claim next to it.

2. Tests pass and lint is clean, in Claude Code

Type this in Claude Code:

/goal All tests in /tests pass with no failures and the lint step returns clean, without editing any existing test files. After each attempt, run the suite and the linter and read the output. Keep fixing and re-running until both are green.

Why it works: the finish line is observable. Claude runs the tests, the result shows up in the transcript, and the checker can confirm it’s green. A goal like “make the app production-ready” would fail here, because nothing in the output proves it.

Bonus: a rewrite that fits the brief

Rewrite this caption so it is under 60 words, has exactly 5 hashtags, and contains no em dashes.

Count the words and the hashtags yourself, scan for em dashes, and if any of the 3 fail, rewrite and check again. Only give it to me once all 3 pass.

The one line to remember

The whole point of a loop is that Claude can measure whether it’s there yet. Give it something to measure, so it does the checking for you.

The weekly email

New guides, first.

One short email a week: the best AI tip I found, and what happened in the ANZ startup scene. Five minutes, no fluff.

By joining, you agree to get emails from jack gpt (Jack Ryan) and to the Privacy policy and Terms. Unsubscribe any time. You must be 18 or over.