Boris Cherny runs Claude Code at Anthropic, and he just said the quiet part out loud: he doesn't prompt Claude anymore. Loops prompt Claude for him. This guide breaks down exactly what a loop is, the two commands inside Claude Code that actually run one, and the copy-paste charter that sets up your first loop today.
Here's the exact quote: "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, the Head of Claude Code at Anthropic, describing his own workflow.
For the last few years, the top AI skill was writing a good prompt. The problem is that prompting keeps you in the room. You type, you wait, you fix, you type again. You're holding the agent's hand the whole time. A loop replaces you in that 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 actually done.
A loop is a system that prompts the agent for you. Every loop, no matter how fancy, is the same five-beat cycle:
1. Find the work. The loop discovers what needs doing: open tasks in a list, failing tests, unanswered emails, items in a queue.
2. Do it. The agent works one item at a time, the same way you would have prompted it manually.
3. Check itself. A verification step decides whether the work is actually done and correct, not just generated.
4. Remember. The loop writes down what it finished (a markdown state file or a task board), so it never redoes work and can pick up where it left off.
5. Go again. It repeats until there's nothing left, then stops or pings you.
That's it. The skill isn't bigger prompts. It's designing this cycle once so the prompting happens without you.
The mindset shift
Prompting is tactical: one instruction, one result. Loop engineering is strategic: you design the system that issues the instructions. It's the difference between doing the work and managing the worker.
Here is the part most people get wrong. You do not build a loop by typing "do this in a loop" into a normal chat. Claude Code has two commands built in that turn the cycle above into a real loop, and which one you reach for depends on the kind of loop you need.
1. /goal is the loop that works until it's done. This is the one that matches everything above. You type /goal followed by what "done" actually looks like, and Claude keeps working turn after turn on its own. Here is the part that makes it real: after every single turn, a second AI quietly checks whether you've hit the goal yet, and if you haven't, it tells Claude why and Claude keeps going. The moment the goal is truly met, the loop stops on its own. That self check after every turn is the whole difference between a real loop and a prompt that runs once and hopes.
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 the character counts so you can confirm it, and do not touch the body copy. Stop when every file passes, or after 25 files.
See why that works: the goal is something Claude can actually measure (character counts), so the checker can tell the exact moment it passed. Claude edits a file, counts the characters, sees it is still too long, fixes it, counts again, and only moves on once it clears the bar. You never typed "try again" once.
2. /loop is the loop that repeats on its own. Reach for this when the work is not "finish a pile" but "keep checking on something." You type /loop with how often and what to do, and Claude re-runs it for you, either on a schedule you set or at a timing it picks itself. This is the loop for things like watching a deploy, or triaging the same inbox every morning.
Try this in Claude Code
/loop 30m check whether my live site is back up by loading the homepage, and the moment it returns a normal page, tell me and stop checking.
The 30m just means every 30 minutes. You can also lead with a plain instruction like "every morning, triage my inbox" and Claude will schedule it for you. Press Esc to stop a loop that is waiting for its next run.
The simplest way to remember it
Use /goal when there is a finish line: work until this is true. Use /loop when there is no finish line, just a rhythm: check this again and again. Most of the powerful loops you will build start with /goal.
If you don't see these yet
Both commands are built into recent versions of Claude Code. If /goal or /loop is not there for you, update Claude Code to the latest version and they will show up.
The two commands above are the engine. These five pieces are the upgrades that make a loop more powerful and more trustworthy. Here's what each one actually is inside Claude Code, and how you turn it on.
1. Automations. This is what makes the loop run on a schedule instead of when you type. The simplest is the /loop command you just saw (every 30 minutes, or every morning). For loops that should run even when no session is open, you can also run Claude headlessly from a scheduler with claude -p "your loop prompt". Scheduled runs are how the loop works while you sleep.
2. Worktrees. Git worktrees give each agent its own isolated copy of your project, so two agents can work at the same time without overwriting each other. In Claude Code you can ask for it directly: "do this in a separate worktree." If you only ever run one agent at a time, you can skip this piece at first.
3. Skills. A skill is a markdown file (in .claude/skills/) that holds the knowledge you keep re-explaining: how your project is structured, your rules, your formats. Write it once and every loop run starts already knowing your project. Easiest start: tell Claude "turn everything I just explained about this project into a skill file."
4. Connectors. These are MCP integrations that let the agent touch your real tools: your email, your task tracker, your Google Drive, your database. Without connectors, a loop can only work on local files. With them, "find the work" can mean "read my inbox" or "check the Linear board." In Claude Code you add them with claude mcp add or through the connectors menu.
5. Sub-agents. The agent that does the work should not be the one grading it. Claude Code lets you define separate agents (in .claude/agents/) so a builder agent does the task and a reviewer agent independently checks it. This one step is what makes loops trustworthy enough to run unattended.
Here is the simplest way to see why a loop beats a prompt. Say you ask Claude to write you a one page brief on a topic. That is the task. The goal, the part that turns it into a loop, is a bar it can measure: every claim has at least three sources, and every link actually opens to a page that backs up what it said.
Without a loop, this is exactly where AI quietly burns you. It hands you a clean looking brief with sources that sound real but do not exist, and it has no idea it made them up. A single prompt cannot catch its own invented source, because it stays confident it is right until something actually opens the link.
With a loop, Claude writes the brief, then goes link by link, actually opening each source to confirm it is real and that it supports the claim. It throws out the fake ones, finds real replacements, and keeps checking until every source on the page is something you can actually open. That is the loop doing the part you used to do by hand.
How you'd actually run it
/goal write a one page brief on [your topic] where every claim has at least three sources and every link actually opens to a page that supports the claim. Open each link to confirm it before you call it done. Replace any source that is dead or does not back up the claim. Stop only when every source on the page checks out.
The one part almost everyone gets wrong
Your goal has to be something Claude can grade itself against: real numbers, a percentage, or a checklist. Not something vague like "make it good." The whole thing only works if Claude can score its own work and know the exact moment it passed. A fuzzy goal gives it nothing to check, so it just stops like a normal prompt.
The two commands are the trigger. This is what you feed them. A one line goal is plenty for a small job, but for a bigger one with many steps you hand the loop a full charter: where to find the work, how to check itself, how to remember, and when to stop. Fill in the brackets, then either paste the whole charter into Claude Code, or drop the GOAL line straight after /goal and keep the rest as its playbook.
Copy this charter into Claude Code when you have a goal with more than one piece of work in it (a backlog, a folder to clean up, a list to process). Run it on its own, or pair the GOAL line with /goal so the built in checker confirms every item for you. It turns Claude from a single-answer tool into a loop that discovers, executes, verifies, and tracks the work until it's done, so you stop babysitting every step.
Copy this prompt
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. Example: "Every product page in /pages has updated pricing and passes the link checker." Be specific about what DONE looks like.] HOW TO FIND THE WORK [Tell it where the work lives. Examples: "Scan the /pages folder for files with old pricing." / "Read TODO.md and treat every unchecked item as a task." / "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. - Follow the project conventions you find in existing files. Match style, don't invent new patterns. - If an item requires a decision only I can make (spending money, deleting things, contacting a person), STOP on that item, add it to a "needs Mariah" list, and move on to the next item. 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.] If verification 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: 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, what needs my decision. Begin by reading LOOP-STATE.md if it exists, then find the work.
Why the state file matters
The state file is what turns ten separate runs into one continuous employee. Without it, every run starts from zero. With it, you can run the same charter on a schedule and the loop always picks up exactly where it left off.
Loops are not free and not for everything. Three honest caveats before you build:
One-off tasks don't need loops. If the work is a single answer (write this email, summarize this doc), a prompt is faster. Loops earn their setup cost on repeating or multi-item work.
Loops burn more usage than prompts. A loop that checks itself and retries is running multiple agent turns per item. On a Claude plan, that means you'll hit usage limits faster. Start with small batches (the "[N] items per run" line in the charter exists for exactly this reason).
Verification is the whole game. An unverified loop just makes mistakes faster. If you can't describe how the loop should check its own work, the task isn't ready to be a loop yet. Keep it as a prompt until you can.
Start this week
Pick one annoying multi-item task you've been doing by hand. Paste the charter, fill in the brackets, run it once while you watch. Once you trust it, schedule it. That's the whole path from prompting to loop engineering.
The Only AI Masterclass You Need
If this guide helped, but you’re looking to go deeper, I got you!! My 30-Day Challenge takes you from saving AI tips you never use to actually building with AI, step-by-step.
I show you exactly how I automated two e-commerce brands, my social media, and most of my personal life, then hand you the agents, workflows & systems to do the same. I’m teaching you every single thing I know with one lesson and one build a day.
Join the AI Masterclass →© 2026 Mariah Brunner. All rights reserved.