How coding agents work
AI-generated summary of reporting by Simon Willison’s Weblog. Read the original for the full story.
Why it matters
Demystifies coding agents as just an LLM plus system prompt plus tool loop, letting engineers build their own instead of treating commercial agents as magic.
Simon Willison explains how AI coding assistants like OpenAI Codex actually work. A coding agent is a large language model, a text-prediction system, wrapped in software that adds extra abilities, such as running commands, using hidden instruction prompts. The model can't remember past chats, so the software resends the whole conversation each time, which is why longer chats cost more. Anyone using tools like Claude or Gemini can benefit from understanding this.
Willison argues coding agents are mechanically simple: an LLM (e.g. Claude Opus 4.6 or Gemini 3.1 Pro), a hidden system prompt, and callable tools in a loop. Costs scale with tokens, providers charge for both input and output, though cached input tokens get cheaper rates, which is why agents avoid editing earlier messages. Teams evaluating or building agents can treat the core as a few dozen lines of code; the competitive edge lies in the surrounding engineering, not the model itself.
An agent harness extends an LLM (tokens in, completion out; multimodal images are tokenized, not OCR'd) with a system prompt and tools invoked via parseable markup like <tool>get_weather("San Francisco")</tool>. Conversations are stateless, so the full history is replayed each turn; prompt-prefix caching reduces input cost, so agents preserve earlier content unchanged. Reasoning modes spend extra tokens on intermediate thinking, aiding debugging. Willison notes a basic tool loop is a few dozen lines of code on an existing LLM API.
Read the original
This summary exists to save you time, not to replace the source.
Key terms
OpenAI Codex Claude Opus 4.6 Gemini 3.1 Pro GPT-5.4 Qwen3.5-35B-A3B OpenAI tokenizer
Was this summary useful?
One click, anonymous. It tells us which summaries to re-run.
Related reading
OpenGame: turn your local coding agent into a full-stack game studio
Developers with a local coding agent can now scaffold full playable 3D games, art, music, testing, publishing, instead of only refactoring code, opening a path from hobby coding to shippable mini-games.
Let Claude Code or any agent tap, type, and read your real phone
Agents can now close the mobile testing gap by driving and reading a real phone themselves, with nothing installed on the device.
n8n's open source personal agent runs on your machine and asks before it acts
Developers uneasy about cloud-based AI agents get a local, approval-gated alternative they can download today, though its research-preview status limits real reliance.
A flight recorder for AI agents that even auditors can verify offline
Teams running AI agents on production systems get tamper-evident, auditor-verifiable records of every tool call instead of logs the agent could rewrite.
A Python client for Ollama, sync or async, local or cloud
Python developers can now use one identical client to call Ollama models locally or via Ollama's cloud API, removing boilerplate and rewriting when scaling up.