
pi-textbook
worthwhileStructured 15-checkpoint course to build a Pi-style coding agent from scratch; essential for engineers who want to understand agent internals beyond



What it is
A textbook and companion code repository that guides you through 15 incremental checkpoints to build a Pi-style coding agent from scratch in TypeScript, covering protocol, streaming, tools, agent loop, session tree, context compaction, extensions, and eval.
How it differs from vanilla Claude
A vanilla capable base agent (Claude) can answer questions about agent internals and generate code snippets, but it cannot provide a structured, test-driven, versioned curriculum with real checkpoints, focused tests, and exercises that force hands-on implementation at each step.
Skill, plugin, or workflow shift?
Knowledge integration: the textbook changes how you understand and build agents, but it is not a plugin, skill, or tool you integrate into your workflow—it's a learning resource that upgrades your mental model.
Devil's advocate — is this just complexity?
A motivated engineer could just read the Pi source code directly or ask Claude to teach them the same concepts, skipping the textbook entirely. The 15-checkpoint structure adds artificial scaffolding—why not just dive into the real codebase? Furthermore, the course code duplicates Pi internals in a simplified form, which could become outdated as Pi evolves. For someone who already understands agent loops, this is a slow, complexity-for-its-own-sake tutorial.
What would make it better
Add interactive exercises that run directly in the browser (like a Jupyter notebook), or an AI tutor that adapts to the student's progress and answers questions contextually. Also, providing a single monorepo with all checkpoints as tags (instead of a separate branch) would reduce onboarding friction.
The honest case for it
This is the rare resource that doesn't just tell you how an agent works—it makes you implement every component from scratch, catching the nuance that eludes abstract explanations. For engineers who want to truly own their agent stack (not just use one), this is far more effective than reading docs or prompting an LLM. The test-first approach and real checkpoints ensure you understand why each piece exists, not just how to wire it up.
Who it's for
Audience fit
Depth and leverage for a technical engineer who wants to understand it and level up their workflow — not just offload work.
Value for someone who wants a more capable tool without the technical depth — accessible, does-it-for-you.
Dives deep into agent internals with hands-on implementation; invaluable for engineers building or customizing agents, but not a ready-to-use tool for vibe coders.