The core cycle every coding agent follows: think about what to do, do it, check the result, repeat.
The Plan-Act-Observe loop is essentially the scientific method applied to coding. An agent starts by planning - reading the task, looking at relevant code, and deciding on an approach. Then it acts - writing code, editing files, running commands. Finally, it observes - checking compiler output, reading test results, examining error messages. Based on what it observes, it plans the next step.
It's like a developer who writes some code, hits "run," reads the error message, and fixes the issue. Except the agent does this loop much faster and doesn't get frustrated by the fifteenth "undefined is not a function" error.
This loop keeps running until the agent either completes the task successfully, hits a limit (token budget, time limit, or max iterations), or gets stuck and asks for help.
Understanding this loop helps you design better workflows. If you know the agent will plan before acting, you can front-load context to improve that planning phase. If you know it observes results, you can provide better feedback mechanisms - clear test output, helpful error messages, type checking.
The quality of each phase matters. Agents with better planning produce more coherent first attempts. Agents with better observation - recognizing when something is truly fixed vs. just suppressing an error - converge faster on correct solutions. Good agentic engineering means optimizing the environment for all three phases.