The full source of Anthropicβs Claude Code CLI leaked through an npm map file 3 weeks ago. 512,000+ lines of production TypeScript. Public now.
A rare look inside how a billion-dollar AI agent is actually engineered β not a tutorial, the real thing.
1,900 files. 512K+ lines of TypeScript. 40+ tools. 50+ slash commands. An MCP server.
Prompt engineers, this is your Rosetta Stone. Agent builders, this is your textbook.
leaked-march-31-2026 Β· public-domain Β· 0/63 on VT Β· read-only study
claude-code/
βββ src/
β βββ main.tsx # Entrypoint β Commander + React + Ink
β βββ QueryEngine.ts # Core LLM API caller (~46K lines)
β βββ tools/ # 40+ agent tool implementations
β βββ commands/ # 50+ slash commands
β βββ bridges/ # VS Code Β· Cursor Β· JetBrains
β βββ prompts/ # π THE SYSTEM PROMPTS
β βββ hooks/ # React hooks incl. permission checks
β βββ mcp-server/ # Installable MCP integration
βββ SKILL.md # How the codebase works
π Why This Is Actually Interesting
The prompts/ folder β the literal system prompts Anthropic ships. How Claude Code is told to behave, sequenced, and constrained. You wonβt find this level of production prompt engineering on Medium or YouTube β ever.
The tool system β every tool Claude Code uses (BashTool, FileEditTool, search_source, etc.) with its own schema, permission model, and execution logic. Blueprint for anyone building their own agent.
The bridges β real integration code for VS Code, Cursor, and JetBrains. Shows exactly how a CLI agent hooks into IDEs.
The SKILL.md at the repo root β Anthropicβs own internal guide for how the codebase is organized. Reading this first = instant orientation.
Runnable MCP server β the repo ships claude-code-explorer-mcp on npm. Use Claude Desktop or Cursor to explore the leaked Claude source. Meta loop.
βοΈ The Tech Stack
TypeScript (strict) Β· Bun Β· React Β· Ink Β· MCP SDK Β· ~1,900 files
Published: 2026-03-31 (made public domain by an Anthropic employee after discovery)
How it got out: the published npm package included a .map file pointing to the full unobfuscated TypeScript source in Anthropicβs R2 storage bucket. @Fried_rice caught it. Anthropic then released it officially.
π₯ Grab It
| Source | Link | Status |
|---|---|---|
| Repo (main) | github.com/tjcrims0nx/claude-code | Re-assembled, browsable |
| Backup branch | backup branch | Original unmodified source |
| ZIP mirror | Google Drive | 9.48 MB |
| VirusTotal | 0 / 63 detections | Clean |
The repo is mirror-at-your-own-risk. Clone it locally if you plan to study it β GitHub DMCAβd copies can vanish overnight.
π§ͺ What You Can Actually Do With It
Read it β itβs TypeScript, strict mode, well-commented. Youβll learn more in an afternoon than six months of agent-building tutorials.
Fork it β for personal study, for research papers, for your own experiments.
Prompt-mine it β extract the system prompts and study how Anthropic phrases constraints, priorities, and tool-use instructions.
Plug it in β run the included MCP server, point Claude Desktop or Cursor at the source, ask it to explain its own architecture.
What you shouldnβt do β repackage it as a commercial product, strip the attribution, or publish a βrebranded Claude Code.β Thatβs how mirrors get nuked fast.
Quick Hits
| Want | Do |
|---|---|
| Gittea repo | |
| Drive mirror | |
| VirusTotal 0/63 | |
Read SKILL.md β src/main.tsx β prompts/ |
|
git clone before any DMCA |
Youβre not βdownloading a leak.β Youβre sitting in the cockpit of an AI agent that shipped to millions. Read the manuals.
!