A 420,000-word teardown of Claude Code's engine
Not a tutorial—an autopsy. This Chinese-language book reverse-engineers the architecture of a production AI agent harness, from async generator loops to permission pipelines.

What it does
This is a free, deeply technical book—15 chapters plus appendices—that dissects how Claude Code actually works under the hood. It covers the conversation loop, tool system, permission pipeline, context compression, memory, hooks, sub-agent forking, MCP integration, and ends with a chapter on building your own harness from scratch. The whole thing is available to read online, licensed CC BY-NC-SA 4.0.
The interesting bit
The book was sparked by a real incident: a security researcher found build misconfiguration in Anthropic’s npm package, the disclosure went viral, and the author realized nobody was systematically explaining why production agents are architected this way. So they wrote the missing manual—139 Mermaid diagrams, 50+ design decisions analyzed, 89 feature flags catalogued. The ancient Chinese carriage metaphor (“Harness” = 舆) is over-the-top, but the engineering detail is not.
Key highlights
- 420K Chinese characters / 75K+ English words across 15 chapters and 4 reference appendices
- 139 architecture diagrams covering 10+ subsystems: tool registry, permission stages, context compression tiers, fork inheritance, MCP bridge protocols
- Explicitly not affiliated with Anthropic; built from public docs and observed product behavior only
- Includes a fast-path reading guide (chapters 01→02→04→15) for the time-pressed
- English translation exists; primary text is Chinese
Caveats
- The book’s origin story cites a March 31, 2026 incident date, which appears to be a typo (likely meant 2025); the README repeats this without correction
- CC BY-NC-SA 4.0 license means no commercial reuse without re-licensing your derivatives
- Some chapter descriptions promise very specific internals (e.g., “160ms→65ms startup optimization”) that the README only asserts, not demonstrates
Verdict
Worth bookmarking if you’re building or debugging agent frameworks and tired of surface-level prompt engineering guides. Skip it if you need a quick “how do I use Claude Code” reference—this is the opposite of that.