alejandrobalderas/claude-code-from-source

1,226 stars · Last commit 2026-04-04

Architecture, patterns & internals of Anthropic's AI coding agent — reverse-engineered from source maps

README preview

# Claude Code from Source

**Architecture, Patterns & Internals of Anthropic's AI Coding Agent**

<p align="center">
  <img src="./web/public/cover.jpg" alt="Claude Code from Source — Book Cover" width="400" />
  <br/><br/>
  <a href="https://claude-code-from-source.com"><strong>Read online at claude-code-from-source.com</strong></a>
</p>

---

> **This repository is purely educational.** It contains no source code from Claude Code — not a single line. Every code block is original pseudocode written to illustrate architectural patterns. The goal is to help engineers understand how production AI agents are built, not to reproduce or redistribute proprietary software.

---

When Anthropic shipped Claude Code on npm, the `.js.map` source maps contained a `sourcesContent` field with the full original TypeScript. This book is the result of studying that architecture and distilling the patterns, trade-offs, and design decisions into a technical narrative that any engineer can learn from.

**18 chapters across 7 parts.** ~400 pages in print equivalent.

View full repository on GitHub →