Modern Creator
Mansel Scheffel · YouTube

Claude Code's Team Just Dropped Their Internal Loops Guide

A 10-minute walkthrough of Anthropic's internal classification of agent loops — four types, two slash commands, and the stop-condition rule that prevents a $6,000 night.

Posted
yesterday
Duration
Format
Tutorial
educational
Views
453
26 likes
Big Idea

The argument in one line.

Anthropic defines four loop primitives on a spectrum from fully manual to fully autonomous, and the stop condition is what separates a useful agent from a $6,000 mistake.

Who This Is For

Read if. Skip if.

READ IF YOU ARE…
  • You use Claude Code regularly and want to understand when /goal and /loop actually make sense to reach for.
  • You are building agentic workflows and have not thought carefully about defining what done looks like.
  • You are already running automated tasks with no stop criteria or token budget and have been lucky so far.
  • You are a non-coder who wants to automate repetitive workflows using AI agents without writing code.
SKIP IF…
  • You need production-grade agent architecture — this is a conceptual overview aimed at beginners, not an implementation guide.
  • You are already fluent in agentic loop design and understand the difference between goal-based and proactive loops in practice.
TL;DR

The full version, fast.

Anthropic published how their Claude Code team actually runs loops internally, categorizing them into four types on a spectrum from manual to fully autonomous. Turn-based is just you hitting enter each time; goal-based hands the stop condition to the model with a retry cap and requires a separate judge model so the agent cannot grade its own homework; time-based adds a timer trigger via /loop for local use or /schedule for cloud runs; proactive combines all three so the agent finds its own work without any human in the loop. The video closes with six token-management rules, anchored by a cautionary graphic about a run that cost $6,000 overnight because no stop condition was set.

Free for members

Chat with this breakdown — free.

Sign in and you get 23 free chat messages on us — ask for the hook, quote a framework, find the exact transcript moment, generate a markdown action plan. Bring your own key when you want unlimited.

Create a free account →
Chapters

Where the time goes.

00:0000:54

01 · What is a loop?

Opens on the Anthropic docs page. Establishes the chatbot vs agent distinction: chatbot answers once; agent gathers context, takes action, verifies work, and repeats. Key slide: 'A loop with no stop condition is a tap left running.'

00:5401:57

02 · Turn-based loops

The human is the loop. Each prompt equals one turn. SKILL.md files provide context; the agent verifies its work and waits for the next Enter. You hand off nothing — you are the stop condition.

01:5703:51

03 · Goal-based loops /goal

Hand off the stop condition. Set a retry cap and a success score. A separate judge model grades each turn — never the same model grading its own output. Best for deterministic work; avoid for subjective tasks.

03:5105:34

04 · Time-based loops /loop + /schedule

A timer kicks off the loop. /loop requires the local machine to be on; /schedule offloads to Anthropic cloud. Use cases: inbox concierge, daily intel brief, lead watcher, invoice chaser. Slide: 'If you ever say remember to check X then do Y, that is a loop.'

05:3407:23

05 · Proactive loops

The highest autonomy tier: /schedule + /goal + skills + auto mode. Agent finds its own work, monitors Slack for bug reports, fans out to parallel dynamic-workflow agents, adversarial judge reviews fixes.

07:2310:28

06 · Keep It Cheap — six rules

Six token-management rules anchored by the '$6,000 Night' graphic: no stop condition, rebuilt 800k tokens, ran 48x overnight. Rules: right primitive + model, clear stop criteria, pilot first, scripts for deterministic work, do not over-schedule, review /usage.

Atomic Insights

Lines worth screenshotting.

  • An agent without a stop condition is not autonomous — it is a tap left running that will drain your API balance overnight.
  • The same model cannot reliably grade its own output; a separate judge model is non-negotiable for goal-based loops to work correctly.
  • Every time you say 'remember to check X then do Y', that is a loop you could hand to an agent with /loop or /schedule.
  • A script that runs the same deterministic logic every time is always cheaper than re-asking an AI to reason through it again.
  • /loop runs while your machine is on; /schedule moves the same task to the cloud and runs whether your laptop is open or not.
  • Goal-based loops work well for objective, measurable tasks but fail for subjective work because the model's taste is not your taste.
  • The proactive loop is the only type where the agent finds its own work — everything below it requires a human to initiate each cycle.
  • Pilot any workflow on a small slice before wrapping it in a loop; what looks right in a test run can churn hundreds of dollars at scale.
  • Dynamic workflows that fan out to parallel agents can deliver faster, adversarially reviewed outputs — but they also multiply token cost.
  • Over-scheduling is its own risk: match the trigger interval to how often the thing you are monitoring actually changes, not to what feels automated.
Takeaway

Stop conditions are cost controls, not just logic gates.

WHAT TO LEARN

Every agent loop that runs without a defined exit condition is a financial liability, not just a technical oversight.

  • The four loop types form an autonomy spectrum: turn-based requires a human each cycle, goal-based hands off retry logic, time-based adds scheduling, proactive combines all three and lets the agent find its own work.
  • A separate judge model is required for goal-based loops to work reliably — the same model that does the work will rationalize its own output as done, even when it is not.
  • Every time a recurring manual check could be expressed as 'check X, then do Y', it is a candidate for a time-based loop via /loop or /schedule.
  • Deterministic, repeatable logic belongs in a script, not an AI call — once a workflow is stable, the AI's judgment adds cost without adding value.
  • The /schedule command moves a loop off the local machine and onto Anthropic's cloud, so it runs regardless of whether the developer's session is open.
  • Token consumption scales with loop frequency and agent count — over-scheduling or using dynamic parallel workflows without a budget cap can generate $6,000 in charges overnight from a single unchecked run.
Glossary

Terms worth knowing.

Turn-based loop
The most basic agent loop where the human initiates every cycle by sending a prompt; the agent cannot proceed until the human acts again.
Goal-based loop
An agent loop that runs autonomously until a specified success condition is met or a maximum retry count is reached, triggered via the /goal slash command.
Stop condition
The definition of done that tells an agent when to exit a loop; without one, the loop continues indefinitely and keeps consuming tokens.
Separate judge
A second, independent model used to evaluate the primary agent's output; prevents the agent from gaming its own grading and declaring success prematurely.
/schedule (Claude Routines)
A Claude Code slash command that offloads a recurring task to Anthropic's cloud infrastructure so it runs on a cron schedule whether the local machine is on or not.
Proactive loop
The highest-autonomy loop type that combines scheduling, goal-setting, and skill files so an agent discovers and completes work with no human in the loop in real time.
Dynamic workflow
A pattern where multiple agents run in parallel on different sub-tasks or perspectives of the same problem, allowing mass concurrent work and adversarial review.
Definition of done
A precise, verifiable success criterion given to an agent so it knows exactly what good output looks like; the single most important input for any goal-based or proactive loop.
Resources

Things they pointed at.

00:00linkAnthropic Getting Started with Loops (docs)
00:43tool/goal slash command (Claude Code)
03:51tool/loop slash command (Claude Code)
05:07toolClaude Routines / /schedule
Quotables

Lines you could clip.

00:25
A loop with no stop condition is a tap left running.
Tight, visual metaphor — standalone as a hookIG reel cold open↗ Tweet quote
02:45
You absolutely do not want the same agent checking its own homework because it can cheat that or gamify it.
Counterintuitive claim with immediate practical consequenceTikTok hook↗ Tweet quote
07:40
A finish line is not just quality control. It is a money control.
Reframes a technical concept as a financial one — high shareabilitynewsletter pull-quote↗ Tweet quote
09:05
A script is cheaper than re-reasoning — ship it once, run it every time.
Actionable rule in one sentenceIG reel cold open↗ Tweet quote
The Script

Word for word.

Read-along

Don't just watch it. Burn it in.

See every word as it's spoken — crank it to 2× and still catch all of it. The same dual-channel trick behind Amazon's Kindle + Audible.

metaphor
00:00So Anthropic just dropped their internal guide about how their Claude Co. Team use loops internally for the engineering work that they do. In this video, we're gonna look at when to use loops and how they work so that you have a very clear picture.
00:10Let's get into it. So put simply, the easiest way to think about a loop at a high level is just that the agent is now taking care of a specific task until it is done in one way or another. For instance, if we look at our image on the left over here, when you're talking to just a simple chatbot, you type in something and you might get an answer back about whatever it is the question that you asked.
00:27But when we're talking to an agent, it's a little bit different because it's taking the context of whatever the question is that you asked, and then it will take action, verify the work that it's done, and it will repeat that until it thinks that the job is done. But, of course, we can manipulate that in as many ways as we want to, and in this guide, we're gonna look at a few of those ways.
00:42Anthropic classify their loops in four ways internally. They have turn based, goal based, time based, and proactive. And you can see the further we go up the scale, the more autonomous the agent become to the point where it's almost like an AI employee.
00:54If we look a little bit deeper into the turn based loop, which is the first one that they define, you can see that it's very familiar to how you might already be using Claude now. We are currently the constraint in this turn based loop over here because we're typing in something or setting off a skill and then hitting enter, and Claude goes out there and achieves its goal.
01:11You're gonna hear a lot of the term definition of done or working towards that definition of done in this video as you might have in some of my other ones. The whole point here is that you always need to provide Claude the ability to understand what good looks like. It's very important from a context engineering perspective, but if you don't do that, it's never gonna know how to do the thing that you do, in which case the loop itself would never work.
01:30So with our turn based loop, we are using Claude how we normally would. We might provide it a skill dot m d over here so that it knows exactly what to work to with each step that we provide it. And then it will verify the work that it has done, checks the results to make sure that it matched against the goal of the skill dot m d file.
01:46And then after checking, it might repeat this, do the next turn, or you might have to hit enter and have another conversation with The point is here, it is iterative. It is turn based. There is no form of automation behind the turn.
01:57The second classification that they have is a goal based loop, and this is literally giving Claude a goal or this definition of done and saying, go and do this by x number amount of tries until this thing is done. When it comes to using goal, it's very important that we actually set some kind of stop criteria here. Otherwise, this thing can just run on for ages, and, obviously, that can run through tokens.
02:15And if it's running on an API, that can actually increase your costs. But you can see the wheel itself doesn't really change. We still have the gather context, take action, verify work, and repeat.
02:24We're now just doing it over and over again until we get to a specific point. Something else that's very important to note here is that we have a separate judge in the picture. You can see on the bottom right over here, we have a different model that checks every single turn because you absolutely do not want the same agent checking its own homework because it can cheat that or gamify it to the point where it thinks that it's done the right thing, but it hasn't.
02:43So it's very important that we have a separate judge to grade the work that we've done as a part of this goal based loop. Using it is really straightforward. You can just come into claw code, whether it's in terminal, Versus code, or inside the actual desktop app, and you just hit forward slash goal.
02:55And you can see over here after that, I would just type in whatever the hell it is that I want this thing to do. In terms of things that it would be good for, you don't necessarily want to give this a task where it is specifically taste based. For instance, if we look at lead gen, there are two parts to that.
03:07There's the research phase of a really long lead list, but then there's also the phase where we would want to write some form of DM to reach out to people based on the research that it's done. Now if we had to go and get this thing to go through that initial list and research everyone and put it into nice files so we can see all the information about them, it's gonna be great at doing that.
03:25But when it comes down to actually writing the DMs for them, that's where it can get a little bit iffy because what the AI thinks good is might not necessarily match your taste because taste itself is more subjective. The way I reach out to people is completely different to the way someone else might depending on the personality type, who you're reaching out to, and a ton of other variables.
03:43The TLDR here on goal is that it's very good for that more deterministic work or that checking off work, but somewhere where there is the subjective piece, you're still gonna need your human in the loop. Then Anthropic takes us to level three, which is their time based loop, and that is loop with a schedule. So with this thing, a timer kicks off whatever it is the task that we want.
04:00Again, our agent loop over here doesn't necessarily change, but what does change is the methodology of what kicks it all off. And you can see here, there are tons of different ways that we can use loops for our everyday workflows. If we have an inbox that constantly gets updated with something, we could have a loop that runs, say, checks your inbox every ten minutes.
04:17Based on that, pulls out the latest email, does a bunch of research or whatever the things that you want done with the email. From there, it goes through its agentic loop, completes the task for you. Job done.
04:25Same thing we could do for our daily intel brief that we get about all the news in the world out there. When the news gets posted online, our little loop runs, gathers that news. Once it's done that, it can take an action like actually writing a video script for you or a blog post, whatever it is that you would want to do with that information.
04:39Same thing for leads, but you get the point by now. And again, using this is really, really straightforward. All you do is flip back over to Claude, you could do something like loop.
04:46And you can see once you hit enter, it asks you for an interval and a prompt. So the first thing that we can do is just put in, let's say, fifteen minutes, and then we could also just run one of our skills. Instead of having to type in a prompt, we could use something that we know works.
04:57So let's just take my Air News monitor. We could hit enter, and then this thing would go and run away in a loop. It might ask you some follow-up questions if it needs any more clarity.
05:05But the point is this would be running locally. So your system always does need to be on, but there is a way to schedule this by using routines, is another part of this process over here. I have a whole deep dive into this video.
05:15So if you wanna learn how routines actually work, go and watch that video. The TLDR being that what we're doing here is this exact news monitor that just ran. We're no longer using it on our local machine.
05:23We use it on Anthropix Cloud. That way, it doesn't matter whether our machine is on or not. You can see it's the exact same thing.
05:28Runs daily at 10:18. You can change this interval much as you would with a normal loop. Then finally, they have the proactive loop, and this pretty much just mixes everything into one bag so that you can kind of get to the point where it's like an AI employee.
05:39For instance, we could have a schedule that monitors our Slack. Anytime something appears in a specific Slack channel that needs work, we could have that run through our routine into a goal. With that goal, it would have a very clear definition of done with perhaps a skill attached to it so that it knows what it needs to be working towards, and it will carry on doing that until that job is done and graded by that judge that we spoke about that's very important for the goal itself.
06:03If we link that with auto mode and perhaps even dynamic workflows, you can really sprawl out these long running tasks. For those of you who don't know what dynamic workflows are, I do have a whole separate video on But just to give you the TLDR, it's essentially a way of having mass agents run their own specific types of work on a workflow that you're trying to run.
06:21It could be deep research. It could also be several agents or with their own persona criticizing an offer that you might have or even verifying the research that the other agents brought back.
06:30The point is here, it really accelerates the kind of work that we can do when we need to get to that type of judgment from multiple points of view. And it also helps us get to a better definition of done when we do have a ton of critics on top of things because, of course, instead of just having that one judge that views our goal, we can have those separate personas all looking at that goal from different angles to make sure that it meets our definition of done.
06:51So in practice, that would look like this. We would have our forward slash schedule, every hour check project feedback, which is inside our Slack for bug reports. The goal here, don't stop until every report found this run is triaged, actioned, and responded to.
07:04When fixing a bug, use a workflow, which is the dynamic workflows I just mentioned, to explore three solutions in parallel work trees and have a judge adversarially review them. To me, that is one of the most perfect use cases of bringing loops into this full circle to get all the amazing benefits of these different processes into one place.
07:21But like most things, you have to have a little bit of fun police information because even though this thing can run forever and ever, you wouldn't want it to, especially if you're using the API. Like I said, this thing can just churn through a ton of money, especially if you've got your card set up on that thing. So use this cautiously with your clients, and more importantly, don't just yolo this thing and say, oh, I run a goal for this.
07:38Think about the work that you're doing. Plan upfront as much as possible because like everything else, the better you are in the planning phase, the better that you're gonna be down the line when you're actually running the work itself. Something else that you need to take into account is managing your token consumption here.
07:52Like I said, this thing can get super hungry. So you need to make sure that you're using the right primitive and the right model for everything that you're running. Don't just use Opus for everything because it's the best.
08:01Like I said, you need to make sure that you're planning this stuff beforehand. See what you can get away with in a single run. Does it give you the output that you want?
08:07Once you get that, then you can start looking at loops and goals and having this thing run autonomously using that thing that you built your test on. Second thing to note here is that all of these things we spoke about, we obviously have our very clear definition of done, which I'm now tired of saying, but secondly, you need to make sure you define the stop criteria.
08:23For a goal, it's the number of times that this thing should retry to get the thing done. That doesn't mean it's always going to use, say, five of them. It's gonna work, and if it finishes in three, it will stop.
08:33But the most it will ever do is up to five. You wanna make sure you have those limits in place. The third point ties in with the first one about selecting your model, but here it is the pilot before the big run.
08:42Always run this with whatever you're gonna be running it before you set it in that loop. Number four is a problem that a lot of people have because they just run everything through AI when it absolutely doesn't need to go through there. Use scripts where you can because that costs absolutely no tokens whatsoever apart from the AI, obviously invoking them.
08:58But you get the point I'm making here. The more deterministic work that we outsource to scripts, whether it's Python or whatever the hell it is that you need to use, the less money and tokens you're going to use over time. The great thing about this as well is that once you figure out how a workflow works, it is a repeatable process.
09:12So you don't need the AI's judgment there anymore. So you should be turning that into a script because you want it to run the same way every single time. That's what we want in business, predictability and reliability.
09:21The fifth thing here is to not overschedule. So when we're looking specifically at forward slash loop and routines and things like that, you don't wanna run this thing every five minutes just because you can. Think about how often a large chunk of emails coming through an inbox or how often a lead lands somewhere where we need actions taken on it.
09:37That way you can define the criteria of how often the schedule should be running as opposed to some arbitrary number that doesn't make sense. Because remember, with Claude routines, get a specific number of runs per day depending on the plan that you're on. And then last but not least, you need to review whatever it is that you're doing using the usage command.
09:52You can track how many tokens that you're using. But even more importantly here, you need to make sure that you're doing that, especially when you get into running those dynamic workflows because, like I said, you can run hundreds of agents, and that will cost you a ridiculous amount of money.
10:04I do recommend that you go and check out my video on workflows before you dive into that because it will show you how to actually use this thing and how to set it up properly. The TLDR here is that you want to pick the right tool, cap the work, and then watch what it's doing over time so that you never spend something you don't have.
10:17So I hope this video was helpful. If you have any comments, leave them down below. I'll get back to you as soon as possible.
10:21Otherwise, check out the videos on the screen now. They'll definitely help you in your journey. Or you can check out my community where I'm helping AI builders every single day.
10:26I'll see you guys later.
The Hook

The bait, then the rug-pull.

Anthropic published the playbook their own engineers use to run agent loops — and it turns out the gap between a useful agent and a $6,000 overnight mistake is a single missing stop condition.

Frameworks

Named ideas worth stealing.

00:43list

The Four Loop Types

  1. Turn-Based
  2. Goal-Based (/goal)
  3. Time-Based (/loop + /schedule)
  4. Proactive

Anthropic's internal classification of agent loops on an autonomy spectrum from fully manual to fully autonomous.

Steal forAny agent workflow planning session — forces you to ask which tier of autonomy is appropriate before you build.
07:47list

Keep It Cheap (6 Token Management Rules)

  1. Right Primitive + Model
  2. Clear Success + Stop Criteria
  3. Pilot Before a Big Run
  4. Scripts for Deterministic Work
  5. Do Not Over-Schedule
  6. Review Usage

Six practical rules for keeping agentic loop costs under control, built around the principle that tokens are money and every loop decision is a spend decision.

Steal forPre-flight checklist before deploying any goal-based or proactive loop in production.
CTA Breakdown

How they asked for the click.

VERBAL ASK
09:59next-video
Check out my video on workflows before you dive into that because it will show you how to actually use this thing and how to set it up properly.

Soft verbal CTA to the Dynamic Workflows video, then end-screen close with community mention. No hard sell.

Storyboard

Visual structure at a glance.

open on docs
hookopen on docs00:00
chatbot vs agent
promisechatbot vs agent00:12
four loop types
valuefour loop types00:43
turn-based loop
valueturn-based loop00:58
goal-based loop
valuegoal-based loop02:01
time-based loop
valuetime-based loop03:51
everyday loops
valueeveryday loops04:07
proactive loop
valueproactive loop05:32
$6,000 night
hook$6,000 night07:27
keep it cheap
valuekeep it cheap07:47
$6,000 night close
cta$6,000 night close09:59
Frame Gallery

Visual moments.

Chat about this