claude-code-source-analysis-orange-book
Health Warn
- No license — Repository has no license file
- Description — Repository has a description
- Active repo — Last push 0 days ago
- Community trust — 116 GitHub stars
Code Warn
- Code scan incomplete — No supported source files were scanned during light audit
Permissions Pass
- Permissions — No dangerous permissions requested
No AI report is available for this listing yet.
Claude Code: Source Code Analysis · Orange Book Series · Deep dive into Claude Code architecture and implementation | 橙皮书系列 · 深入解析Claude Code架构与实现
Claude Code: Source Code Analysis
Dissecting Anthropic's AI Engineering Decisions from 510,000 Lines of Leaked Code
Orange Book Series | April 2026 | By Huashu
📖 Read Online (Official Web Edition, Chinese — TOC navigation, chapter search & mobile layout): Read free on huasheng.ai →
About This Book
On March 31, 2026, Anthropic accidentally shipped the complete Claude Code source code inside an npm package. 1,902 TypeScript files, 510,000 lines of code, every design decision laid bare.
This book is not a source code reading journal. It dissects the design decisions behind Claude Code -- one of the world's most sophisticated AI coding tools. Why does search use grep instead of a vector database? Why does the memory system only store preferences, not code? Why does Auto mode run a second AI for safety reviews? Why Bun over Node.js?
Every choice has a reason. Those reasons are more valuable than the code itself, because they are transferable.
Downloads
| Version | File | Pages |
|---|---|---|
| English | Claude-Code-Source-Code-Analysis-v260411.pdf | ~80 |
| Chinese | Claude-Code-Source-Analysis-zh-v260411.pdf | ~80 |
💡 Download the PDF for the best reading experience. GitHub's online preview may not render properly.
Table of Contents
Part I -- The Big Picture
- Ch 01 A Billion-Dollar Blueprint
- Ch 02 Architecture Overview: The Skeleton of the Harness
Part II -- Core Systems
- Ch 03 System Prompt Engineering
- Ch 04 The Tool System: 4 Primitives, 59 Tools
- Ch 05 The Permission System: Trust by Design
- Ch 06 The Memory System: Remember Preferences, Forget Code
- Ch 07 Context Management: Surviving Long Conversations
- Ch 08 Search: Why grep Beats RAG
Part III -- Advanced Architecture
- Ch 09 Multi-Agent Architecture: Run Like a Company
- Ch 10 The Future in Feature Flags
- Ch 11 Two Claude Codes: Internal vs External
Part IV -- Methodology
- Ch 12 The Harness Engineering Playbook
Key Insights
- 60/40 Rule: Claude Code is 60% model capability, 40% harness engineering
- grep > RAG: 510,000 lines of code, zero vector databases -- because the LLM is smart enough
- Remember preferences, forget code: Memory stores what changes slowly; search retrieves what changes fast
- Four-layer permission pipeline: Rule matching -> low-risk skip -> allowlist -> ML classifier
- Nine-section structured compression: Not "summarize this" but a strict template for what must be preserved
- Simple components + smart brain: File-based communication, plain-text memory, grep search -- each component is simple, but together they outperform complex alternatives
About the Author
Huashu -- AI Native Coder, indie developer, AI content creator with 300K+ followers.
Notable works: Kitten Ring Light (App Store Paid #1), Master DeepSeek in One Book (bestseller)
Links
- X/Twitter: @AlchainHust
- YouTube: @Alchain
- Bilibili: Huashu
- WeChat Official Account: Huashu
- Website: huasheng.ai
Orange Book Series
This book is part of the AI Programming Orange Book Series:
- Claude Code: From Beginner to Pro -- How to use the tool
- Claude Code: Source Code Analysis -- How it's built (this book)
- Harness Engineering -- The methodology
- Agent Skills -- Extending AI capabilities
- OpenClaw -- Building your own AI
- Polymarket Guide -- Prediction markets with AI
📚 Read Online on WorkBuddy
This book is also available on WorkBuddy's knowledge base, one page per chapter — or just drop the link into your agent as context.
https://www.workbuddy.cn/space/d/XFmwjvAbcxmujlmXdftvlK
All orange books: https://www.workbuddy.cn/space/d/YcllWXknAUoMk6lFSWdfbI
License
This work is provided for educational and research purposes. The source code analysis is based on publicly available leaked code. All trademarks belong to their respective owners.
Disclaimer
This book is based on analysis of TypeScript source code publicly exposed during the Claude Code v2.1.88 leak in March 2026. The analysis covers client-side tool code only and does not involve model weights, training data, or user information.
Reviews (0)
Sign in to leave a review.
Leave a reviewNo results found