Claude Code's Guts, Rebuilt from Accidentally Shipped Maps
A technical book that teaches production agent architecture by studying the source maps Anthropic left on npm.

What it does
This repository is an ~400-page technical book split into 18 chapters that studies the architecture of Anthropic’s Claude Code agent. The author extracted insights from the .js.map source maps shipped on npm—whose sourcesContent field still held the original TypeScript—and distilled them into narrative chapters, diagrams, and original pseudocode. It is purely educational: not a single line of proprietary code is redistributed.
The interesting bit
The project is also a case study in recursive dogfooding: 36 AI agents analyzed roughly two thousand files, wrote 494 KB of raw notes, and rewrote everything into chapters in about six hours. The result is a layered text meant for both technical leaders and implementers, with an “Apply This” section at the end of each chapter that extracts stealable patterns.
Key highlights
- 18 chapters across 7 parts covering the core loop, multi-agent orchestration, terminal UI, MCP, and performance engineering.
- Every code block is original pseudocode with renamed variables; no proprietary source, prompts, or constants are included.
- 10 concrete architectural patterns are catalogued, including speculative tool execution, fork-agent prompt-cache sharing, and 4-layer context compression.
- Diagrams use Mermaid and render natively in GitHub’s markdown viewer.
- Each chapter offers a narrative flow for leaders and deep-dive sections for engineers who actually have to build this stuff.
Caveats
- This is explicitly not a runnable clone; every code block is original pseudocode, and no proprietary source is included.
- The entire analysis and writing process was performed by 36 AI agents in approximately six hours, which may show in the texture of the prose.
- It is an independent, unaffiliated analysis based on source maps from a specific npm build.
Verdict
Senior engineers building agentic systems or complex terminal UIs should treat the “10 Patterns” list as a checklist for their own designs. Skip it if you want a ready-to-use alternative to Claude Code.
Frequently asked
- What is alejandrobalderas/claude-code-from-source?
- A technical book that teaches production agent architecture by studying the source maps Anthropic left on npm.
- Is claude-code-from-source open source?
- Yes — alejandrobalderas/claude-code-from-source is an open-source project tracked on heatdrop.
- What language is claude-code-from-source written in?
- alejandrobalderas/claude-code-from-source is primarily written in TypeScript.
- How popular is claude-code-from-source?
- alejandrobalderas/claude-code-from-source has 2.7k stars on GitHub and is currently cooling off.
- Where can I find claude-code-from-source?
- alejandrobalderas/claude-code-from-source is on GitHub at https://github.com/alejandrobalderas/claude-code-from-source.