"You shouldn't be prompting coding agents anymore. You should be designing loops that prompt your agents."
— Peter Steinberger
That line is where this course starts. This lesson does the groundwork it needs.
Manual prompting, and the thing that isn't
Manual prompting looks like this: you write a prompt, wait, read the result, write the next one.
A loop looks different. You write the goal once and it keeps going by itself, checking its own work against the condition you wrote, until it decides that condition holds.
The difference isn't effort inside one turn. It's who is driving between turns: you, or the loop.
The cycle
A loop is one repeating cycle with four phases.
- Goal — a condition that is either true or it isn't. Never a vibe.
- Act — edit code, run a command, call a tool.
- Observe — what actually happened. A test result, a diff, real output — never the agent's own summary of what it thinks it did.
- Adjust — then go around again.
And if the goal never holds? Something outside the loop has to stop it: an iteration cap, or you. That stopping rule matters as much as the goal does, and it is the thread the rest of the course pulls on.
The four loop types
Sorted by the one thing that separates them — what starts the next pass.
| Type | What starts the next pass |
|---|---|
| Turn-based | You do. An ordinary chat: nothing moves until you type. |
| Goal-based | The loop does. Fix these failing tests, written once, running until they pass. |
| Time-based | A clock does. Wakes on an interval, checks one thing, sleeps. |
| Proactive | An event does. A webhook. A pull request. A ticket closing. |
Goal-based is where this course starts.
After this lesson
You will be able to explain a loop as one repeating cycle that runs until a verifiable condition holds, and place a real task on the right side of the four types — including this course's running example, which lands on goal-based.
What comes next
Naming isn't building. You could stop here knowing the vocabulary and still have zero loops running.
In Lesson 1.2 you write a real goal-based loop, and add a guardrail that a hook — a script Claude Code runs before a tool call — can enforce, but the wording of your goal never can.
Prerequisites
You are already using Claude Code, and you know what an agent, a tool call, MCP, and a git worktree are. None of those are introduced from scratch.
Companion article
Every hook, script, and command in this course, written up and executed: How to build an agent loop in Claude Code