Skip to main content

Agentic Loop Simulator

Watch a coding agent run an agentic loop, one step at a time. A planner, a builder, and a judge cycle through plan, build, verify, and repeat until the goal is met. Toggle the separate judge off to see why an agent grading its own work ships confident bugs. An animation-first, interactive explainer of loop engineering and how it maps to Claude Code.

Category: DevOps

What You Will Learn

  • What an agentic loop is: plan, build, judge, then repeat until the goal is met
  • Why a coding agent finishes multi-step work on its own instead of answering once
  • How the decision at the end of each loop chooses to keep going or stop
  • Why the judge should be a separate agent, and what happens when it is not
  • Why token cost compounds as the context window grows each loop
  • How the phases map to Claude Code: subagents, the Read/Edit/Bash tools, and a stop condition

Topics covered: ai, agents, agentic, loops, loop-engineering, claude-code, llm, coding-agents, automation, educational, interactive

// simulator

Agentic Loop Simulator

Watch a coding agent run an agentic loop, one step at a time. A planner, a builder, and a judge cycle through plan, build, verify, and repeat until the goal is met. Toggle the separate judge off to see why an agent grading its own work ships confident bugs. An animation-first, interactive explainer of loop engineering and how it maps to Claude Code.

Supported byDigitalOceanDevDojoSMTPfastQuizAPIBecome a sponsor

Agentic loop · three agents

A loop of three agents: plan, build, judge

Task: add a working /signup endpoint (hash the password, return 201)
or use ← →Speed
1
Plan
planner agent

Decide the single next step toward the goal.

idle
2
Build
builder agent + tools

Do it: read, edit, run a command.

idle
3
Judge
judge agent (separate)

Grade the result against the goal and spec.

idle
the judge decides: loop or stop
readyPress Play to watch three agents build a feature together, one loop at a time. Slow by default.

Loop state

Iteration0 / loops
Tokens this run0k
The whole context is re-sent every loop, so cost climbs as it grows.
Goal: hashed pw + 201not met
Test suitenot run

Context window (grows each loop)

Empty. The agents start with just the task.
PlanIn Claude Code: a planner subagent, or a plan-mode turn that writes the next step.
BuildThe main agent using Read, Edit, Bash to change the code.
JudgeA separate reviewer subagent, ideally a different model, checking against tests and the spec.

Illustrative model of the multi-agent loop pattern (plan → build → judge → repeat) used by coding agents like Claude Code. It shows the harness and the role split, not any model's internal reasoning. Turn the separate judge off to see why an agent grading its own work ships confident bugs.

About this agentic loop simulator

What you'll learn

  • How a coding agent runs a loop instead of answering a single prompt
  • The three roles: a planner picks the next step, a builder does it, a judge checks it
  • Why "the tests pass" is not the same as "the goal is met"
  • Why the judge being a separate agent is what stops the loop shipping confident bugs
  • How the context window grows each loop, and why that makes cost climb
  • What each phase maps to in Claude Code

How the loop works

  • Plan: gather the goal and the last result, decide the single next step
  • Build: take one action, read a file, edit code, run a command
  • Judge: grade the result against the goal and the spec, not just the tests
  • Decide: goal met means stop, not met means loop back to plan

Watch the verifier make the difference

The single most important control in the simulator is the "separate judge agent" toggle. With it on, a second agent reviews the work against the spec and catches a status code the builder got wrong. Turn it off and the builder grades its own work, sees green tests, and stops, shipping a confident bug. That is the whole reason serious agent loops split the agent that writes the code from the agent that checks it.

How this maps to Claude Code

Plan and Judge are the kind of work you hand to a subagent, often a different model, so the judge is not grading its own homework. Build is the main agent using the Read, Edit, and Bash tools. The loop runs until a goal condition or a turn limit, the same way a real harness keeps an agent going until the work is actually done.

Go deeper

The companion post, Stop Prompting, Start Looping, covers why engineers at Anthropic, NVIDIA, and beyond say the job is shifting from writing prompts to designing loops, and what actually makes a loop reliable rather than an expensive way to ship bugs.

Why learn it this way?

  • The loop is a simple cycle, but it is the thing that turns a chatbot into an agent.
  • Seeing the plan, build, and judge steps hand off makes the pattern concrete.
  • Watching an unverified loop finish wrong is the fastest way to learn why verification matters.

Try next

Sponsored
Carbon Ads
$ cd /games
// share