Yü Yu: Decoding the Agent Harness
A 420,000-character Chinese technical book that dissects Claude Code's Agent Harness chapter by chapter, from the conversation loop to building your own harness.
This is a technical book/documentation repository, not an executable agent product; assessable evidence is the repo's own engineering. Workflows use least privilege (contents:read for checks, contents:write only for star-history) with concurrency groups and timeouts: 2. Dependencies are pinned exactly (jsdom 26.1.0, mermaid 11.17.2): dependency_security 2. README explicitly disclaims official status and third-party license coverage: source_attribution 3. user_confirmation, data_flow_transparency, sensitive_data_handling and rollback are only book topics (permission pipeline, hook safety) with no runtime mechanism in this repo to verify — deducted to 1. No evidence of malicious behavior or excessive defaults.
test_star_history.py covers scheduling boundaries, deterministic and self-contained rendering, and even asserts workflow cron and README image paths — good internal consistency: 2. CI runs all checks with pinned Node/Python versions: dependency_availability 2. Almost no user-facing error messages exist to assess: failure_messages 1.
README offers multiple reading paths (first-time, hands-on, reference) with clear chapter structure: audience_and_scenarios 3. Reading notes explicitly distinguish source-confirmed behavior, architectural inference, and teaching examples, and disclaim that counts/timings are not release commitments: capability_boundaries 2. trigger_precision is not really applicable to a documentation repo: 1. Environment requirements are explicit (Node ≥22, Python 3.12): environment_fit 2.
Excellent information architecture: 15 chapters in 4 parts plus 4 appendices, navigation map, glossary: 3. License clearly CC BY-NC-SA 4.0 with third-party rights preserved: license 3. Contribution process and pre-commit checks documented: maintenance_responsibility 2. Install commands given (npm ci, check scripts): install_notes 2. No CHANGELOG or version scheme: versioning_changelog 1. known_limitations rests on the reading-notes disclaimer: 2.
As a Chinese-language deep-dive on Claude Code architecture, the topic is distinctive, structure complete, with exercises and a build roadmap: marginal_value 2. Chapters readable online, self-contained SVGs, bilingual sync requirement: output_usability 2. Cost is reading time for systematic architectural understanding: cost_benefit 2; not higher because chapter content was not verified line-by-line in this static review.
Appendix A provides a source-navigation map and data-flow paths: claim_traceability 2. Reading notes explicitly ask readers to separate fact from inference: fact_inference_separation 3. Claims are not cross-corroborated against independent sources, and no mechanism pinning claims to specific Claude Code versions/commits is visible in the provided files: cross_source_corroboration 1.
- This is a third-party analytical book about Claude Code, not an official Anthropic publication; described behaviors may drift as Claude Code evolves — verify against official docs and source for critical decisions.
- The book contains architectural inference and teaching examples distinct from source-confirmed behavior; readers should follow the reading notes and not treat inference as fact.
- The book is licensed CC BY-NC-SA 4.0 (attribution, non-commercial, share-alike), restricting commercial use; third-party source content is not covered by this license.
- This was a static review; no chapter exercises were executed and technical assertions were not independently validated.
What does this agent do, and when should you use it?
《御舆:解码 Agent Harness》(Decoding the Agent Harness) is an open-source Chinese technical book in the lintsinghua/claude-code-book repository — 15 chapters and 4 appendices deeply analyzing the internal architecture of Anthropic's Claude Code. It is organized in four parts: a foundations section building a mental model (conversation loop, tool system, permission pipeline), a core-systems section dissecting configuration, memory, context management, and hooks, an advanced-patterns section covering sub-agents, multi-agent orchestration, skills/plugins, and MCP integration, and an engineering section on performance optimization plus a six-step roadmap for building your own harness. The title borrows '舆' (the carriage body) from the ancient Chinese text Kaogongji, metaphor for the runtime framework that carries an agent. Four appendices provide an architecture navigation map of 16 core modules, a 50+ tool inventory, a 89-flag quick reference, and 100 bilingual terms. The text is licensed CC BY-NC-SA 4.0, readable online, with an English edition.
This is not runnable software but a documentation-style technical book. It reads and cites Claude Code source code and produces chapter texts with Mermaid architecture diagrams: Chapter 2 analyzes the while(true) async-generator main loop, five yield events, and QueryDeps dependency injection; Chapter 3 covers the Tool<I,O,P> protocol and buildTool fail-safe factory; Chapter 4 dissects the four-stage permission pipeline; Chapter 7 presents the four-level context compression chain (Snip→MicroCompact→Collapse→AutoCompact); Chapter 12 explains MCP's five-state connection management and Bridge communication; Chapter 15 gives a six-step roadmap for building a harness from scratch. Appendix A provides a 16-module dependency tree and 6 data-flow paths; Appendices B–D cover 50+ tools, 89 feature flags, and a glossary. The repo ships scripts/check_book.py and unit tests for content validation; Mermaid checks require Node.js 22.
- Senior engineers who want an authoritative architectural dissection of Claude Code rather than scattered official docs
- Architects designing their own AI agent runtime, using Chapter 15's six-step roadmap and security threat model as a blueprint
- Developers building tools, plugins, or MCP servers for Claude Code, using Appendix B's tool inventory and Chapters 11–12 as interface references
- Practitioners researching agent context engineering and memory, studying Chapter 6–7's four memory types and four-level compression strategy
- Technical writers and translators needing a canonical Chinese-English vocabulary, citing the 100 terms in Appendix D
What are this agent's strengths and limitations?
- A rare systematic architectural dissection of Claude Code — 15 chapters covering the full chain from conversation loop to multi-agent orchestration
- The appendices (16-module dependency tree, 50+ tool inventory, 89-flag table) work as on-demand reference material, not just linear narrative
- Explicitly separates source-confirmed behavior from architectural inference and teaching examples, and declares itself non-official — intellectually rigorous
- Chapter 15 offers an actionable six-step roadmap for building your own harness, including circular-dependency solutions and a four-layer observability stack
- Feature flags and tool counts depend on specific build/runtime versions; content may drift as Claude Code evolves
- Some content is architectural inference rather than line-by-line source verification, so readers must evaluate carefully
- Primarily Chinese (with an English edition); non-Chinese readers depend on bilingual sync quality
- CC BY-NC-SA 4.0 prohibits commercial use, and the license does not cover Claude Code's third-party source code itself
How do you install or deploy this agent?
No software to install. Read online at https://lintsinghua.github.io/ . For local reading: git clone https://github.com/lintsinghua/claude-code-book.git and open the Markdown chapters (e.g. 00-前言.md). To contribute revisions you also need Python 3 for validation scripts, and Node.js 22 (npm ci, then npm run check:diagrams for Mermaid checks).
How do you use this agent?
First-read path: start with the preface, then read 01 → 02 → 04 → 15. Hands-on building path: read the foundations and engineering-practice parts first, then consult parts 2 and 3 as you add memory and extension capabilities. Reference use: Appendix A locates modules, B lists tool properties, C indexes feature flags, D defines terminology. Note the book's reading guidance: distinguish source-confirmed behavior from architectural inference and teaching examples; feature flags and tool availability depend on build and runtime configuration.
How does this agent compare with similar options?
The book complements Anthropic's official Claude Code documentation: official docs explain how to use it, this book explains how it works internally — better suited for architecture-level understanding, but not a substitute for official docs as a usage guide.