What is a loop?
Prompting, looping, and structuring loops. Three ways to work with a coding agent, what changes from one to the next, and where loop0 fits.
Everyone talks about loops now. Anthropic's own guide defines them as "agents repeating cycles of work until a stop condition is met". That is a good definition. Here is what it means in practice, in three scenarios: prompting, looping, and structured loops.
1. Prompt engineering: you are the loop
You write a prompt, you read the result, you adjust, you try again. Prompt, result, iteration. Prompt, result, iteration. It works, and it is how most of us started.
There is a loop here, but you are the one running it. Every turn goes through you: you check the answer, you decide what is wrong, you write the next prompt. When you stop, the loop stops, and what it learned stays in the conversation.
2. A loop: an objective, many iterations
With a coding agent, the shape changes. You give an objective and what "done" means. The agent then runs as many iterations as it needs, one after the other: it gathers context, makes a change, checks it, and goes again until the objective is met. Claude Code's documentation describes exactly this cycle — gather context, take action, verify results — and adds: "You're part of this loop too."
What makes the difference is that the agent can check its own work. It can run the tests, start the application and use it. You step in at the start and at the end, not at every turn.
Code is a natural fit for this: a test passes or it does not, the application starts or it does not. The loop has something real to close on.
3. loop0: loops that are structured and standardized
A loop reaches one objective. A project is many loops. And between two loops, the agent forgets: each new session starts from a fresh context. The quality of the next loop depends on what the last one left behind — and, too often, on what you remember to tell it.
loop0 optimizes, structures and standardizes the loops themselves:
- The same foundation for every loop: the vision, the product, the architecture, the standards, the way of working, written once in the repository. The first loop is about this foundation more than about features.
- The same shape for every mission: what it must deliver, what it makes mandatory, criteria a person can check.
- The same verification: tests, then real use — the application tried the way its user will use it: a browser for a web app, the window for a desktop app or a game, a terminal for a command-line tool. What could not be checked is said, not hidden.
- The same trace: a report, the decisions, the documents kept current, and what is unfinished carried into the next loop.
- The same place for you: you approve the mission and you accept the loop.
The agent still does the work. loop0 makes every loop start from the same ground and leave the same ground for the next one.
The three side by side
| Prompt engineering | A loop | loop0 | |
|---|---|---|---|
| Who runs the iterations | you | the agent | the agent |
| What "done" means | when you are satisfied | the objective you set | the mission's criteria, checked |
| What stays afterwards | a conversation | a result | a result and a written trace |
| Between two pieces of work | you start over | you brief the agent again | the next loop starts from the last |
| Your role | operator | the one who sets the goal | the one who decides and accepts |
Start simple
Anthropic's advice is a good one to end on: "Not all tasks require complex loops; start with the simplest solution." A quick question still deserves a quick prompt. A feature deserves a loop. A product deserves loops that build on each other — that is where structure pays off.
Sources: Anthropic, Loop engineering: Getting started with loops (June 2026) · Claude Code documentation, How Claude Code works.