Claude reads its own source code, writes 17-chapter autopsy
A 477K-line TypeScript codebase dissected by the very model it powers, published in English and Chinese.

What it does This repository hosts a 17-chapter architectural deep-dive into Claude Code v2.1.88 — not the source itself, but a structured engineering analysis written by Claude after reading its own 1,902-file, 477,439-line TypeScript codebase. It covers the query engine, tool system, multi-agent coordination, permission pipelines, context compression, and a dozen other subsystems. The whole thing is bilingual (EN/ZH) and rendered as a searchable GitHub Pages site.
The interesting bit The recursive gimmick is real: the model being analyzed is the author. The README leans into the absurdity (“imagine the AI’s mood”), but the content is straight-faced technical — architecture diagrams, code walkthroughs, and design patterns extracted from a proprietary codebase that had to be reconstructed from source maps by the community.
Key highlights
- 17 chapters mapping every major subsystem, from a 12-step query-engine state machine to a 7-layer permission pipeline
- Core design philosophy: “intelligence lives in the LLM; the scaffold is just a loop” — a
while(true)harness around 42+ tools - Multi-agent “swarm” coordination with three backends (iTerm2, tmux, in-process) and mailbox-based IPC
- Four-tier context compression to squeeze within 200K-token windows
- Terminal UI built on a fork of Ink + React 19, with Vim mode and IDE bridge support
- Bilingual from the ground up, not machine-translated as an afterthought
Caveats
- The actual Claude Code source is not in this repo; analysis is based on community-reconstructed code from source maps (linked but unverified)
- Some chapter line-count claims (e.g. “1.88万行代码” for the plugin system) describe the analyzed codebase, not the analysis document itself — easy to misread
- “Undercover mode” and “remote kill switch” are mentioned in chapter 17 but not detailed in the README; the telemetry discussion may raise eyebrows without the full text
Verdict Worth your time if you’re building agentic tools, wrestling with context windows, or curious how a production LLM client orchestrates 42 tools without collapsing into spaghetti. Skip it if you need runnable code — this is documentation, not a fork.