The Art of Building AI Coding Agents

A book that builds the agent that builds the book

The Art of Building AI Coding Agents — Cover

© 2026 by Bill Cox, waywardgeert@gmail.com

This book was written with the assistance of AI coding agents — Claude (Anthropic) and GPT (OpenAI). The epilogue was written by Astra (GPT-6) from inside the agent the book describes.

What this is

I wanted to know if an AI coding agent could be rebuilt from a book describing how to build one. Not in theory — actually. So I wrote the book, built the graders, ran the crossover, and published the result.

The agent you build by following these chapters is called Ensemble. Twenty chapters take you from a bare conversation loop to a streaming GUI with tool execution, jobs, actors, skills, persistence, MCP, context engineering, memory, prompt caching, and a vendor migration — each with a graded exercise and mutation-tested auto-grader.

The crossover experiment: an agent reads this book and rebuilds Ensemble from scratch, then uses that rebuilt agent to review and improve the book that built it. This first edition was released immediately after that crossover succeeded.

Get the book

The free version will always be available here and on GitHub. If you'd rather read on a Kindle or hold a paper copy, it's the same text on Amazon:

What's in it

Each chapter builds one capability, includes a graded exercise, and leaves the agent in a working state. The graders are real — every exercise ships with mutation tests proving the grader catches specific violations.

  • Chapters 0–2: Conversations, history, and the vendor seam
  • Chapters 3–4: Tool execution and background jobs
  • Chapters 5–6: Modularization and the actor framework
  • Chapter 7: Streaming (SSE parsing, three vendors)
  • Chapters 8–9: The browser GUI and settings
  • Chapters 10–11: Skills and persistence
  • Chapters 12–13: MCP and the agent inspecting its own GUI
  • Chapter 14: Speech synthesis and the virtual user
  • Chapters 15–17: Context engineering, memory, and auto-recall
  • Chapters 18–19: Prompt caching and leaving Anthropic for OpenAI
  • Chapter 20: The crossover — chat CLI, GUI polish, vendor switching

First edition

This is the first edition. Advanced topics still in the pipeline include dynamic workflows, sandboxing, connectors, prompt injection defense, sub-agents and swarm management, and gateways. The free version will always be up to date.