This is part two of our five-part series on agentic harnesses. In part one we defined the harness as everything wrapping the model and broke it into four parts: the agent loop, the tool interface, context management and control mechanisms. This post opens the hood on the first two, the runtime core that turns a model from a talker into a doer.
The Agent Loop
A bare language model does one thing: given some text, it produces more text. That's a single round-trip. The agent loop is what wraps that round-trip in a cycle so the model can pursue a goal across many steps.
The dominant pattern is the ReAct loop: the model reasons about what to do next, takes an action through a tool, observes the result, and goes around again, all inside a plain while loop that runs until the goal is met.
The main agent execution pattern today is a ReAct loop, where a model reasons, takes an action via a tool call, observes the result, and repeats in a while loop.
This idea has a lineage. ReAct-style reasoning loops appeared in 2022, AutoGPT popularised long-running autonomy in 2023, and the "Ralph loop" (a bash one-liner that keeps re-running an agent until it finishes) made the rounds in 2025. By 2026 the pattern was productised directly into tools like Codex and Claude Code as /loop and /goal commands.
The loop sounds trivial, but the craft is in its edges. When should it continue, and when should it stop? How does it recover from a tool that errors or a step that went sideways? How do you keep it from spinning forever on a task it can't finish? A good loop has clear stopping conditions and a way to back out of a dead end, and that's the difference between an agent that finishes and one that loops uselessly.
