Ryan on the 1s and 0s
← All posts

I Had Claude Write Me a Book on AI Agents

How I turned "things I want to learn" into a book that rebuilds itself, and what's still rough about it.

Every word of Agents A2Z was written by AI. Claude wrote all 16 chapters, the 8 hands-on labs, and every revision since. My part was choosing what it should cover and building the automation around it. Read it as an AI-generated study guide, not an expert reference, and check anything you plan to rely on.

Download the book: PDF · ePub

I wanted to actually understand AI agents, not just use them. Not the hype version, the working version, you know, how the agent loop works, what MCP servers are for, when retrieval beats fine-tuning, how you keep any of it safe in production, etc.

I also had a vacation coming up and wanted something to read on it. So instead of collecting a pile of blog posts and docs, I asked Claude to write me a book.

Starting from what I knew and what I didn't

I didn't start from a blank page (obviously). I started from a list of things I already knew, the parts of agents I already understood a little, and the parts I knew of but I didn't understand at all. My prompts came from that list.

The first pass came back as a complete book in one commit. It has sixteen chapters in five parts, from the landscape of agents and frontier versus local models, through prompting, agent definition files, Skills, building agents in Python, tool use, MCP, and multi-agent orchestration, to RAG, fine-tuning, observability, production hardening, and safety. It ends with a glossary.

Eight of the chapters come with a Google Colab notebook, so the code isn't just something to read. One has you hand-write the agent loop, another builds a small MCP server and client, and another runs a LoRA fine-tune on a small model. Unfortunately the labs are private for now, so the book mentions them but you can't open them yet. I plan to make them public later. The problem is that they were placed in the same private repo as the book itself. Oops. Honestly though, I never had the intention of making this available to the general public.

Growing the book one topic at a time

The first version wasn't the end of it. Whenever I hit a topic I wanted to learn, I asked Claude to add it, and Claude decided where it belonged. I never had to decide which chapter a new idea should go in, or rework the surrounding text so it still flowed. I named the topic, and Claude worked it in.

Before: a book that only lived on GitHub

At that point the book was a folder of Markdown files. It read fine on GitHub, and that's fine for a few pages, but that's a bad way to read 116 pages, especially on a vacation. I wanted something I could open on a tablet or e-reader.

So I had GitHub Copilot build a GitHub Actions workflow to compile the book whenever it changes.

After: every push produces a new edition

Now the whole loop looks like this:

  Me: "I want to learn about X"
            |
            v
  Claude decides where X belongs,
  writes it, and pushes to main
            |
            v
  GitHub Actions: Pandoc combines the chapters,
  renders Mermaid diagrams, builds a PDF and an ePub
            |
            v
  A new GitHub Release ("Docs build #N")
  with Agents-A2Z.pdf and Agents-A2Z.epub

On every push to main, the workflow:

  1. Installs Pandoc, LaTeX, and the Mermaid CLI.
  2. Combines the chapter files in order, rendering diagrams and callout boxes with a small Pandoc Lua filter.
  3. Builds the PDF and the ePub, each with a table of contents.
  4. Publishes both as a new GitHub Release, numbered by build.

The difference is that adding a topic now ends with a new edition of the book, not just a Markdown file I have to read on GitHub. Asking a question, getting a chapter section back, and having it in a readable file are one step instead of three.

What's still imperfect

Getting here wasn't smooth, and it still isn't polished.

The automation took about ten commits of trial and error on its own. Mermaid's command-line tool runs a headless Chrome, which wouldn't start inside GitHub's build environment until it was run without Chrome's sandbox. The callout boxes, which GitHub renders with icons and colors, came out as plain quoted text until a custom filter learned to recognize them. I have put no effort into determining if there's a better way to handle the Actions and just let Copilot do its thing.

The formatting still isn't where I'd like it. The PDF is a straight Pandoc-and-LaTeX conversion, so it reads like a long document rather than a designed book. The diagrams are ill-sized, as are the code blocks, and the overall layout lacks the polish of a professionally designed book.

The release history is noisy too. Every push creates a release, so a small fix becomes a new "edition" alongside the real ones. But really who cares about that?

And the bigger caveat is the one at the top: this is AI-generated content. It's well organized and easy to read, which makes it easy to trust more than you should. Treat it as a guided starting point, and go to primary sources for anything you'll build on. What it isn't is just "AI Slop" thrown together without thought.

What I learned

  • Asking for a book beats asking questions one at a time. The structure is the valuable part. Each new topic lands next to related ideas, with cross-references to earlier chapters, instead of in a loose pile of chat threads.
  • Deciding what to learn becomes the real work. The world is now learning this lesson about AI: when writing costs almost nothing, the useful skill is knowing which question to ask next or which direction to go next.
  • Automation is what keeps it alive. I feel like I'm late to the party here because we didn't use GitHub until very recently at work. GitHub Actions are becoming my new favorite thing. Without the build, every addition would have meant converting files by hand, and I would have stopped adding things and I certainly wouldn't be building a new PDF or ePub every time there was a change.
  • Splitting the work between tools worked. I'm trying to incorporate the use of multiple agents as well as multiple tools in my workflows. Claude wrote and organized the content, and Copilot built the pipeline. Neither needed to do the other's job.

The files here are the November 24, 2026 edition. The book will keep changing, so this copy may fall behind.