← Back to all free guides

Stop Prompting.
Start Loop Engineering

Boris Cherny runs Claude Code at Anthropic, and he says he doesn’t prompt Claude anymore. Loops prompt Claude for him. Here’s what a loop is, the commands that run one, and a copy-paste charter for your first loop today.

Here’s the quote, as Addy Osmani shared it: "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’s Boris Cherny, Head of Claude Code at Anthropic, describing his own workflow.

Prompting keeps you in the room. You type, you wait, you fix, you type again. A loop takes your seat. You hand it one goal, and it finds the work, does it, checks itself, remembers what it finished, and goes again until the goal is done.

Sources: Addy Osmani’s loop engineering breakdown and the X post that started this.

What A Loop Actually Is

Every loop, no matter how fancy, runs the same five beats.

  1. Find the work. Open tasks in a list, failing tests, items in a queue.
  2. Do it. One item at a time, the way you would have prompted it by hand.
  3. Check itself. A verification step decides whether the work is actually right, not just finished.
  4. Remember. It writes down what it finished in a state file or task board, so it never redoes work.
  5. Go again. It repeats until nothing is left, then stops or pings you.

The skill isn’t bigger prompts. It’s designing this cycle once so the prompting happens without you.

The Commands That Run A Loop

Typing "do this in a loop" into a normal chat doesn’t build one. Claude Code has commands built in for it, and which one you use depends on the kind of loop.

01

/goal works until it’s done

Type /goal plus what "done" looks like, and Claude keeps working turn after turn. After every turn, a separate model checks whether the condition is met. If not, Claude keeps going. When it’s met, the loop stops. (How goals work)

Try This In Claude Code
/goal every blog post in the /posts folder has a meta description under 160 characters and a title under 60 characters. After each file, print its title and description character counts so the result shows in the chat. Don't touch the body copy. Stop when every file passes, or after 25 files.

That works because the goal is measurable. The checker only reads what shows up in the chat, so asking Claude to print the counts gives it proof to judge. To let it run without stopping to ask permission, use auto mode. /goal clear stops it early.

02

/loop repeats on a rhythm

Use this when there’s no finish pile, just something to keep checking, like a deploy. Give it an interval and a prompt. Leave out the interval and Claude picks its own pace.

Try This In Claude Code
/loop 30m load my homepage at [your URL] and check whether it returns a normal page. The moment it does, tell me what you saw and cancel this loop.

It only runs while your session is open, and repeating tasks expire after 7 days. To stop a fixed-interval loop like this one, ask Claude to cancel it. Esc only stops a loop where Claude picks the timing. (Loop docs)

03

/schedule runs while you sleep

For something like "every weekday at 9am, review open pull requests," type /schedule and describe it. Claude sets up a cloud scheduled task (formerly called routines) that runs on Anthropic’s servers, even with your laptop closed. It’s on Pro, Max, Ultra, Team and Enterprise. (Scheduled task docs)

The Easy Way To Remember

Finish line? Use /goal. Rhythm while you work? Use /loop. Needs to run without you? Use /schedule. If a command is missing, update Claude Code.

The Five Pieces That Make It Stronger

Addy Osmani lists five pieces that make a loop more powerful and more trustworthy. Here’s each one in Claude Code.

  1. Automations. The schedule. That’s /loop and /schedule above, or claude -p "your prompt" run from your own scheduler.
  2. Worktrees. Each agent gets its own copy of your project so parallel agents don’t overwrite each other. Start one with claude --worktree. Skip this if you run one agent at a time.
  3. Skills. A SKILL.md file in .claude/skills/ that holds what you keep re-explaining: your structure, rules and formats. Ask Claude to turn what you just explained into a skill.
  4. Connectors. MCP servers that let the agent touch your real tools, like email, a task tracker or a database. Add them with claude mcp add and manage them with /mcp.
  5. Subagents. The agent doing the work shouldn’t grade it. Define a reviewer in .claude/agents/ that checks the builder’s work.
A Real Example

Ask Claude for a one-page research brief and it can hand you clean-looking sources that don’t exist. A single prompt stays confident until something actually opens the link.

A loop fixes that. The goal becomes a bar Claude can measure: every claim has at least three sources, and every link opens to a page that backs it up. Claude writes the brief, opens each link, throws out the fakes, finds real replacements and keeps going until every source checks out.

Self-Checking Brief
/goal a one-page brief on [your topic] is saved as brief.md, where every claim has at least 3 sources and every source link has been opened with web fetch and confirmed to support the claim. After checking each link, print the URL and the exact line from the page that backs the claim, so the proof shows in the chat. Replace any source that is dead or doesn't back the claim. Never invent a source. If a claim can't get 3 real sources, cut the claim and say so.

The Part Most People Get Wrong

Your goal has to be something Claude can grade itself against, like numbers, a percentage or a checklist. "Make it good" gives it nothing to check.

Your First Loop: The Charter

A one-line goal is plenty for a small job. For bigger work like a backlog or a folder to clean up, hand the loop a full charter. Fill in the brackets and paste it into Claude Code, or put the GOAL line after /goal so the built-in checker confirms every item.

The Loop Charter
You are running as a loop, not answering a single prompt. Here is your charter. GOAL [Describe the finished state in one or two sentences, e.g. "Every product page in /pages has the new pricing and passes the link checker." Be specific about what DONE looks like.] HOW TO FIND THE WORK [Where the work lives, e.g. "Scan /pages for files with old pricing" or "Read TODO.md and treat every unchecked item as a task" or "Check my connected task board for items tagged ai."] HOW TO DO THE WORK - Work on ONE item at a time. Finish it completely before starting the next. - Match the conventions in the existing files. Don't invent new patterns. - If an item needs a decision only I can make (spending money, deleting things, contacting a person), STOP on that item, add it to a "needs me" list, and move on. HOW TO CHECK YOURSELF After each item, verify it before marking it done: [Pick what fits: "run the tests" / "re-read the file and confirm it meets the goal" / "take a screenshot and confirm it looks right."] Verification means evidence, not confidence. Print the evidence. If it fails, fix it and verify again. Maximum 3 attempts per item, then log it as blocked and move on. HOW TO REMEMBER Keep a file called LOOP-STATE.md. After every item, update it with the item name, status (done / blocked / needs me), what you changed, and anything the next run needs to know. Read this file FIRST at the start of every run so you never redo finished work. WHEN TO STOP Stop when (a) every item is done or logged as blocked, or (b) you've completed [N] items this run. Then give me a short report: what got done, what's blocked, and what needs my decision. Begin by reading LOOP-STATE.md if it exists, then find the work.

The state file turns ten separate runs into one continuous worker. Without it, every run starts from zero.

When Not To Loop
  1. One-off tasks. Writing one email or summarizing one doc? A prompt is faster. Loops pay off on repeating or multi-item work.
  2. Usage. A loop that checks itself and retries runs several turns per item, so you’ll hit plan limits faster. Start small, which is why the charter caps items per run.
  3. No way to check. An unverified loop just makes mistakes faster. If you can’t describe how it should check its work, keep it a prompt for now.

Start this week. Pick one annoying multi-item task, paste the charter, and watch it run once. Once you trust it, schedule it.