🔓 Claude Code Source Leaked — 512K Lines of Agent Engineering, Free

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

:brain: 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.

:hammer_and_wrench: 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.

:bridge_at_night: The bridges — real integration code for VS Code, Cursor, and JetBrains. Shows exactly how a CLI agent hooks into IDEs.

:scroll: The SKILL.md at the repo root — Anthropic’s own internal guide for how the codebase is organized. Reading this first = instant orientation.

:electric_plug: 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

:light_bulb: 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

:open_book: Read it — it’s TypeScript, strict mode, well-commented. You’ll learn more in an afternoon than six months of agent-building tutorials.

:fork_and_knife: Fork it — for personal study, for research papers, for your own experiments.

:magnifying_glass_tilted_left: Prompt-mine it — extract the system prompts and study how Anthropic phrases constraints, priorities, and tool-use instructions.

:puzzle_piece: Plug it in — run the included MCP server, point Claude Desktop or Cursor at the source, ask it to explain its own architecture.

:prohibited: 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.


:high_voltage: Quick Hits

Want Do
:bullseye: Browse the source Gittea repo
:floppy_disk: Download ZIP Drive mirror
:microscope: Verify clean VirusTotal 0/63
:blue_book: Start here Read SKILL.md → src/main.tsx → prompts/
:hourglass_not_done: Archive it local 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.

17 curtidas