Concept

The Agentic Loop

Plan → act → observe → adjust. Understanding this loop is the difference between fighting the agent and flowing with it.

Every step the agent takes follows the same four-beat rhythm. Plan: decide what to do next based on the current goal and context. Act: call a tool — read a file, run a command, edit code. Observe: read the tool's output. Adjust: update the plan based on what came back, then loop.

When you understand this rhythm, two things happen. First, you stop interrupting mid-loop — you let the agent finish its observation before adding new constraints. Second, you start writing prompts that *front-load* the constraints, because constraints added before a loop starts are cheap; constraints added in the middle force a re-plan.

Concretely: 'Refactor the auth module. Keep the public API stable. Add tests for every changed file.' is a complete loop input. 'Refactor the auth module' followed by 'oh and don't break the API' two minutes later is a re-plan that costs you turns.

Sandbox transcript
Claude Code · sandbox replay
Press Play to replay this transcript step-by-step.
0 / 9

The transcript is canned — no real API calls. The point is to internalize the loop: user → plan → tool → result → answer.

Check your understanding
Q1. Which sequence describes one beat of the agentic loop?
Q2. Why is front-loading constraints in your prompt cheaper than adding them later?
· Score 100% on the quiz.