Claude Code from Source
Architecture, Patterns & Internals of Anthropic's AI Coding Agent. 18 chapters across 7 parts. ~400 pages.
Reverse-engineered from source maps. Every chapter has transferable patterns you can steal for your own systems.
Foundations
Before the agent can think, the process must exist.
The 6 key abstractions, data flow, permission system, build system
5-phase init, module-level I/O parallelism, trust boundary
Bootstrap singleton, AppState store, sticky latches, cost tracking
Multi-provider client, prompt cache, streaming, error recovery
The Core Loop
The heartbeat of the agent: stream, act, observe, repeat.
Multi-Agent Orchestration
One agent is powerful. Many agents working together are transformative.
Persistence and Intelligence
An agent without memory makes the same mistakes forever.
The Interface
Everything the user sees passes through this layer.
Connectivity
The agent reaches beyond localhost.
Performance Engineering
Making it all fast enough that humans don't notice the machinery.