Inside Claude Code

20-page deep dive into Anthropic's AI coding agent — from source code. 1,902 files, 513K lines of TypeScript. Click any page to dive in.

01
Overview & Stack
Bun runtime, Ink UI, Zustand state, 4 providers, 6 MCP transports, directory map
02
Architecture & Boot
System flow, core loop, rendering pipeline, state layers, boot sequence, src/ folder structure, feature gates
03
Query Loop
Async generator, 6-step flow, continuation decisions, post-sampling hooks
04
Tool Catalog
43 tools, streaming executor, sibling abort, fork cache sharing
05
Permissions
3-layer model, 7 modes, 8 rule sources, bash AST analysis
06
Context & Autocompact
167K threshold, hybrid token counting, 4 strategies, circuit breaker
07
API & Providers
Why 4 providers, feature matrix, retry strategy, fast mode states
08
Subagents & Swarm
7-step lifecycle, fork mechanics, 6 agent types, team topology, backends
09
Memory System
MEMORY.md as pointer index, Sonnet selection, 4 types, autoDream
10
Security
6-layer defense, 24 bash validators, ML classifier, never-bypassable
11
Extensions
Priority order, MCP/Skills/Agents/Hooks/Plugins/CLAUDE.md
12
CLI & Hidden Internals
84 commands, 24+ internal, 170+ env vars, 26 feature flags
13
Architecture Critique
God object, SOLID scorecard, 4,684-line main.tsx, 187 imports
14
Speculation System
Overlay filesystem, pre-computed turns, pipelined speculation, state machine
15
Buddy Companion
18 species, rarity tiers, stats, hats, shiny 1%, procedural generation
16
Computer Use & Voice
Chicago MCP (Rust/Swift), voice mode (SoX → STT), kill-switches
17
Telemetry
3-layer pipeline, PII never-type trick, GrowthBook, Datadog
18
Team Memory Sync
Delta upload, SHA-256 hashing, secret scanning, conflict resolution
19
Coordinator & Deep Links
Worker orchestration, scratchpads, claude-cli:// URIs
20
Easter Eggs & Evolution
200+ spinner verbs, codenames, model migrations, Chrome integration