How a coding agent works
A coding agent is a loop. The model generates text - it has no direct access to files, the shell, or anything else. When it wants to read a file, it outputs a structured request. The loop picks that up, runs the operation, and feeds the result back into the conversation.
The loop keeps running until the model produces a response with no tool calls. The LLM is also stateless, so the loop maintains a session - every message saved as a node, the full conversation reconstructed before each model call. When sessions grow too long, old messages get summarized into a checkpoint, which is itself just another model call.
Full walk-through: Coding Agent Anatomy.