title: Step Through the Agent Loop description: Name who does each of ten steps in one agent bug fix: the model, the harness or a tool, and watch the context window fill. status: built image: /sims/agent-loop-stepper/agent-loop-stepper.png og:image: /sims/agent-loop-stepper/agent-loop-stepper.png twitter:image: /sims/agent-loop-stepper/agent-loop-stepper.png social: cards: false quality_score: 0
Step Through the Agent Loop¶
Run the Step Through the Agent Loop MicroSim Fullscreen
About This MicroSim¶
An agent gets one task: "Add a 10-second timeout to the image-search adapter. When it fires, mark the photo check 'not checked'. Add a test." The sim splits that fix into ten steps. Before each step happens, you say who does it: the model, the harness or a tool.
The three boxes show the actors. The model decides what to do and writes text, including requests to use a tool. The harness builds every prompt, checks permission and carries out each request. A tool does the work, such as searching the code or running the tests. The model only talks to the harness, and it never touches a file.
Two bars track the context window. The first shows how full an illustrative 200,000-token window is. The second shows what fills it, by source. By the end, tool results make up about 60 percent of the 34,900 tokens, and the builder's request is about 40 of them.
The token counts are illustrative.
How to Use¶
- Read the task at the top and the action for step 1.
- Pick who does it with the Model, Harness or Tool button, or click one of the three boxes.
- Read the feedback. The step's tokens move into the context window.
- Press Next step. Picks can't be changed once revealed.
- After step 10, read the summary: your score, the final context size, and the share that came from tool results.
- Hover over a box, a bar segment or the share bar for details. Press Start over to try again.
Mastery is 8 of 10 correct on the first pass.
Iframe Embed Code¶
You can add this MicroSim to any web page by adding this to your HTML:
<iframe src="https://arunbatchu.github.io/good-enough-engineering/sims/agent-loop-stepper/main.html"
height="564px"
width="100%"
scrolling="no"></iframe>
Lesson Plan¶
Learning Objective¶
The learner will classify each of the ten actions in one agent bug-fix loop as done by the model, the harness or a tool, with at least eight of ten correct.
Grade Level¶
Adult professional (Good Enough Engineering)
Duration¶
10-15 minutes
Prerequisites¶
- Large language model
- AI coding agent
- Agent harness
- Agent tool use
- Context window
- Prompt
Activities¶
- Exploration (5 min): Before starting, say out loud who you think reads the adapter file. Then step through all ten actions.
- Guided Practice (5 min): For each miss, read the Why text and name the misconception behind your pick.
- Assessment (5 min): Explain in two sentences why tool results, not the builder's request, fill most of the window.
Assessment¶
- 8 or more of 10 steps classified correctly on the first pass.
- The learner can say why the model never touches a file directly.
Common Misconceptions¶
- The model reads and edits files directly.
- The builder's request is most of what the model reads.
- The model decides on its own whether an action needs permission.
References¶
- Chapter 4: AI Coding Agents - the sections "The Harness", "Agent Tool Use" and "A Worked Example: One Loop Through a Bug Fix."
- Building Effective Agents - Anthropic, 2024. Describes agents as models using tools in a loop.