$ cat ~/map/learn-pi-agent.md
learn-pi-agent
A chapter-by-chapter rebuild of Pi's agent harness, from one LLM call to a working coding agent.
tutorials✓ Sep 4
Facts
- repository
- github.com/yiz-hhh/learn-pi-agent ↗
- GitHub Stars
- ★ 4
- Forks
- 0
- license
- MIT
- npm / mo
- —
- last push
- Sep 4, 2026
## TL;DR
A bilingual study project that rebuilds the Pi agent harness in ordered chapters — from a minimal LLM call through tool calling, sessions, compaction, skills, and extensions to an assembled coding agent.
## Key points
- $Chapters evolve in order from a minimal LLM call through parallel tool execution, steering and follow-up, context transformation, the session tree, compaction, skills, and the extension runtime to a final assembled coding agent.
- $Each chapter continues the previous chapter's open questions while keeping an independent implementation and its own tests.
- $Written against Pi's Agent Core and Coding Agent sources, examining where each mechanism's complexity lives — MCP, subagents, permission prompts, plan mode, and todos are deliberately left out of Pi's default product and composed when needed.
- $Chinese-first with an English README; the online docs build (yiz-hhh.github.io/learn-pi-agent) mirrors the chapters but is currently written in Chinese.
- $Runs on npm workspaces: npm install at the repo root, then npm run build and npm test type-check and test every chapter.
## FAQ
Q Is this an official Pi tutorial?
No — it is an independent study project that reads Pi's Agent Core and Coding Agent implementations as its reference.
Q What does the final chapter cover?
Chapter 12 assembles the coding agent from the coding tools built so far; chapter 11 just before it composes permission gates, plan mode, and subagents on the extension runtime.
## References
## Related entries
$ I tried Pi after watching its founder explain why he quit Claude Code
A hands-on dev.to write-up of trying Pi after hearing its founder's case against Claude Code.
$ Pi documentation (pi.dev)
The official Pi site and documentation — installation, configuration, extensions, and themes.
$ pi-bluebook (Pi 学习蓝皮书)
Free unofficial Chinese-language learning path that takes Pi beginners from first install to skills, extensions, and long-running workflows.
## Guides
Last updated: Sep 4, 2026