Inside a Coding Agent
Build the harness end to end, from the tool loop to an agent that ships real code.
Coding agents are treated as magic. This book takes one apart. You build a real agent one capability at a time: the tool loop, event-sourced sessions, a fail-closed sandbox, context assembly, subagents, until it takes an engineering task, edits code across a repo, runs commands, and verifies its own work. It runs on the engine you built in the first book.
Every listing on these pages is pulled from a real, working repository at a pinned commit, and every command's output was captured from actually running it. Nothing here is typed from memory.
- The Three Tools: Bash, Read, Edit
- The Agent Loop
- The Command Line: Metering and the Transcript
- Streaming and Mid-Stream Tool Calls
- Event-Sourced Sessions: Append, Resume, Fork
- Deterministic, Byte-Exact Replay
- The Provider Seam
- The Fail-Closed Sandbox
- Policy-Gated Approvals
- Framing Tool Output as Untrusted Data
- Context Assembly and Progressive Disclosure
- History Compaction
- Durable Memory and Output Spill
- The Ranked Repo Map
- Subagents and Fork-Seeded Context
- Prompt Caching, Verified End to End
- MCP: Tools over stdio JSON-RPC
- Workflows and the Ralph Loop
- The Plugin Seam
- The Hardening Pass
- The Session Viewer: Timeline and Transcript
- The Session Viewer: Analytics and Live Chat
- The Eval Harness: Forge vs a Hosted Model