What's Inside
16 Chapters of Deep Analysis
Chapter 01
What is Harness Engineering?
The three pillars: Context Engineering, Architectural Constraints, Entropy Management. With quantitative ROI data.
Chapter 02
Claude Code Architecture
512K LOC TypeScript. Bun runtime. React+Ink terminal UI. 37 source directories mapped.
Chapter 03
The Agent Loop
queryLoop(): 7 continue sites, 10 exit reasons, 4-level compaction, StreamingToolExecutor. Real source code.
Chapter 04
Tool System
43+ tools. Tool interface with 60+ methods. Partition algorithm. FileEditTool's quote-aware replacement.
Chapter 05
Permission Model
5 modes, 7-level hierarchy, YOLO two-stage classifier, defense-in-depth 6 layers.
Chapter 06
Hooks System
26 events, 4 hook types, async protocol, prompt request protocol, 70% fast-path optimization.
Chapter 07
Sandbox & Security
Filesystem, network, process isolation. Hardcoded denials. Git bare repo attack prevention.
Chapter 08
Context Engineering
CLAUDE.md, 4-type memory system, 4-level compaction pipeline, 200K window budget allocation.
Chapter 09–12
Settings, MCP, Agents, Skills
7-level config hierarchy, 6 MCP transports, 5 agent types, skill frontmatter parsing.
Chapter 13–14
Practical Guide & Philosophy
3-level harness maturity. 10 design philosophies. Entropy management patterns.
Chapter 15
Build a Mini Harness
200-line Python implementation from scratch. 5 layers matching Claude Code. Runnable exercises.
Chapter 16
Competitor Analysis
Claude Code vs Cursor vs Copilot. 12-dimension comparison. OpenDev paper insights.