AI Without the Hype.
Chapter 9 of 17
Part Three · Architecture for Non-Coders · Chapter 09

/loop and /goal
at depth

By the end of this chapter you understand the loop that turns a one-time answer into a system that runs itself, and you can lock a goal clear enough to steer that loop and catch it when it drifts.
AVATAR OPENER · ~90s
Watch: a locked goal, and a loop running toward it while you watch the edges
HeyGen avatar · generated, consistent presenter

A prompt teaches you to talk to AI. A loop teaches you to control it. That is the jump this chapter is about. So far you have run the model by hand, one exchange at a time. Now you meet the thing that runs it for you: a model using tools in a loop, working toward a goal, until it is done or you stop it.

That phrase, a model using tools in a loop, is not a metaphor. It is the actual definition of an agent, and it is worth seeing the mechanism plainly, because once you have, a lot of intimidating words like agent and automation collapse into something simple you can reason about.

THE LOOP, PLAINLY

Here is the whole thing. The model is given a task and a set of tools it is allowed to use. It thinks, and either it answers and stops, or it asks to use a tool. The tool runs, the result comes back to the model, and it thinks again with that new information. That cycle repeats until the model decides the job is done. That is the loop, and it is genuinely all there is to it.

Give it a task and tools
You hand the model the goal and the set of things it is allowed to do. This is the part you own.
It thinks and acts
The model reasons, then either answers or reaches for a tool. Reaching for a tool is what makes it more than a chat.
Result feeds back, repeat
The tool runs, the outcome returns to the model, and it thinks again with new information. Round and round until done.
It stops when finished
When the model judges the task complete, the loop ends and hands you the result.
You own the loop and the tools. The model owns the reasoning. You decide what it is trying to do and what it is allowed to touch. It decides how to get there. Keep that line clear and loops stay yours.

That division of labour is the safety rail for everything in this part of the course. The loop and the tools are yours: you choose the goal, you choose what the model can reach, you decide when to step in. The reasoning is the model's: how to actually get from here to done. Trouble almost always comes from blurring that line, either handing the model reasoning you should have kept, or handing it tools you should not have given it. Keep the line sharp and a loop is a servant. Blur it and it is a liability.

/GOAL: THE NORTH STAR YOU LOCK

A loop is only as good as the goal you point it at, because a loop will pursue what you actually said with a persistence a single answer never does. A vague goal followed once gives you a vague answer you shrug at. A vague goal followed in a loop gives you a machine confidently doing the wrong thing, over and over. So the goal comes first, and you lock it before the loop starts.

Locking a goal means writing down, clearly enough to check against, what done looks like. Not a direction, a destination. This is the same discipline as the founder-mode gate you will meet later: name the goal, name what finished actually means, and keep that written somewhere you can hold the work against it. Then, as the loop runs, you are not asking "is it busy?" You are asking "is it still heading at the locked goal, or has it drifted?"

Name the destination
Write what done looks like in checkable terms, not a vague direction. "A working X that does Y" beats "improve X".
Write it down
A goal in your head drifts silently. A goal on paper is something the work, and you, can be measured against at any moment.
Check drift against it
The loop’s job is progress toward the locked goal. Yours is to keep asking whether it still is, and to stop it when it is not.
One goal, not five
A loop chasing several goals at once serves none well. Lock one clear destination per loop, and let the others wait their turn.
/LOOP: WHAT MAKES IT A SYSTEM, NOT A RUN

The difference between running the model by hand and building a loop is the difference between doing a job and building the thing that does the job. A run happens once, when you are there. A loop can run on a trigger, when you are not: on a schedule, or when something happens. That is what turns a task into a system, and it is the real subject of this chapter.

The pattern that makes big loops manageable is to break the goal into phases. Instead of "do the whole thing," you have the loop work in named stages, each with its own small done-check, so you can see progress and catch drift at each boundary instead of only at the end. A loop that reports "phase one complete, here is what I have, moving to phase two" is one you can steer. A loop that goes dark for an hour and hands you a finished mess is one you cannot.

Spec a loop for one recurring job
I want to turn a recurring job into a loop that can run on its own. The job: [describe it, e.g. "every morning, gather my new emails and messages and give me a short briefing of what needs a reply"]. Help me spec it before we build anything: - The locked goal: what "done" looks like, in checkable terms. - The phases: break it into a few named stages, each with its own small done-check, so I can see progress and catch drift. - The tools it needs, and nothing more than that. - The trigger: what starts it (a schedule, an event), and the stop condition that ends it. - Where I stay in the loop: which points I want to review before it continues. Do not build it yet. I want the spec I could hand off.
Try it in Claude
What a loop spec looks like
Goal: a five-line morning briefing of what genuinely needs my reply today, no noise, in my inbox by 8am. Phases: 1) gather overnight messages, 2) filter to what needs action, 3) draft the five-line briefing. Each phase reports before the next. Tools: read-only access to the inbox, nothing that can send or delete. Trigger: 7:55am daily. Stop: briefing delivered, or nothing to report. I review: the filter step, until I trust it, then I let it run clean.
THE AUTONOMY SLIDER

How much rope you give a loop is a dial, not a switch, an idea Andrej Karpathy describes as an autonomy slider. At one end, the model asks before every action and you approve each step. At the other, it runs the whole job untouched and reports at the end. Neither end is correct in general. The right amount of autonomy depends on how reversible the work is and how much you trust the loop on this particular task.

The honest rule of thumb, and this is ours rather than Karpathy's: start a new loop near the cautious end, watching closely, and slide toward more autonomy only as it earns your trust on that specific job. A loop that only reads and reports can run freely from day one, because the worst case is a wasted run. A loop that can change or send or delete things stays on a short leash until you have watched it behave, because there the worst case actually costs you. Match the rope to the stakes.

Building a real triggered loop, one that runs on a schedule and touches your actual tools, needs the terminal and the connections you set up in the next chapters. This chapter is the thinking that makes those safe: lock the goal, break it into phases, give it only the tools it needs, and set the autonomy to match the stakes. The mechanics come next.

NOW YOU TRY · DESIGN
Turn one recurring job into a loop spec

Take one job you do on a rhythm, every morning, every Friday, every time a certain thing happens. Use the spec prompt above. Lock the goal in checkable terms. Break it into a few phases with done-checks. List only the tools it truly needs. Set the trigger and stop condition. And decide, honestly, where on the autonomy slider it should start, based on whether it can do damage. Do not build it. The spec is the deliverable.

Right if you have a loop spec so clear that someone else could build it, with a checkable goal, phased progress, minimal tools, and an honest autonomy setting for its risk level.
Show the worked solution
The drill works when the spec makes the risks obvious before a single line is built. Say the job is "every Friday, turn my week's notes into the update I send my team." The locked goal is not "summarise my week", it is "a team update in my usual four-section format, covering only what actually happened, ready in my drafts by Friday noon", something you can hold the output against. The phases give you control: gather the week's notes, sort them into the four sections, draft in your voice, each reporting before the next so you catch a wrong turn early. The tools are deliberately thin: read the notes, write a draft. Notice what is not on the list, it cannot send the update, because sending is a judgment you keep. The trigger is Friday morning, the stop is "draft ready." And the autonomy setting is the honest part: because this loop can only read and draft, never send, you can let it run fairly freely, worst case is a draft you rewrite. Contrast a loop that could actually email the team: that one starts on a tight leash, reviewing every step, until it has earned trust, because there a mistake reaches real people. Same shape of job, different rope, and the difference is entirely about what the loop can touch. That judgment, matching autonomy to stakes, is the whole point of specifying before building.
WATCH FOR
You point a loop at a vague goal. A loop pursues exactly what you said, relentlessly. Lock a checkable "done" first, or you get a machine confidently doing the wrong thing.
You give a loop more tools than the job needs. Every extra tool is extra risk. Grant only what the task requires, especially anything that can send, change, or delete.
You set a big loop to full autonomy on day one. Start cautious and watch. Slide toward more autonomy only as the loop earns trust on that specific job, and keep destructive loops on a short leash.
Your loop runs dark and hands you a finished mess. Break it into phases with done-checks that report as they go, so you can catch drift at each boundary instead of only at the end.
WHAT YOU LEARNED
The takeaways
  • An agent is just a model using tools in a loop: think, act with a tool, feed the result back, repeat, stop when done.
  • You own the loop and the tools; the model owns the reasoning. Keeping that line sharp is the safety rail for every automation.
  • Lock the goal before the loop runs: write what done looks like in checkable terms, then watch for drift against it, not just for busyness.
  • A loop becomes a system when it runs on a trigger. Break big loops into named phases with done-checks so you can steer them mid-run.
  • Autonomy is a slider, not a switch. Start cautious, grant only the tools the job needs, and give more rope only as the loop earns trust and only when the work is safe to undo.
Your project · spec a loop

Write a loop spec for one recurring job in your thread project: locked goal, phases, minimal tools, trigger, and an honest autonomy setting. That closes Part Three. You have the terminal, enough structure, and the loop concept. Next we make loops real: connecting the model to live tools by building your own connection, starting with MCP.

A prompt is a sentence. A loop is a system. The moment you lock a clear goal and let a model pursue it with the right tools and the right amount of rope, you stop operating AI one answer at a time and start running it. That is the whole climb of this course, made mechanical.