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

**URL:** <https://onehack.st/t/claude-code-source-leaked-512k-lines-of-agent-engineering-free/321387>\
**Category:** Tools & Scripts\
**Tags:** tips-tricks\
**Created:** [April 20, 2026, 9:59pm UTC](https://onehack.st/t/claude-code-source-leaked-512k-lines-of-agent-engineering-free/321387 "2026-04-20T21:59:15Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![GrimXLock](https://onehack.st/user_avatar/onehack.st/grimxlock/32/174321_2.png) [@GrimXLock](https://onehack.st/u/GrimXLock)\
**Post date:** [April 20, 2026, 9:59pm UTC](https://onehack.st/t/claude-code-source-leaked-512k-lines-of-agent-engineering-free/321387/1 "2026-04-20T21:59:15Z")

</div>

_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`

* * *

```auto
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](https://twitter.com/Fried_rice) caught it. Anthropic then released it officially.

> **📥 Grab It**
>
> | Source | Link | Status |
> | --- | --- | --- |
> | **Repo (main)** | [github.com/tjcrims0nx/claude-code](https://github.com/tjcrims0nx/claude-code) | Re-assembled, browsable |
> | **Backup branch** | [backup branch](https://github.com/tjcrims0nx/claude-code/tree/backup) | Original unmodified source |
> | **ZIP mirror** | [Google Drive](https://drive.google.com/file/d/1fEgEi-y6T-Ouc5fnQAiZnvtKy56vnGHt/view?usp=drivesdk) | 9.48 MB |
> | **VirusTotal** | [0 / 63 detections](https://www.virustotal.com/gui/file/0d70d04a5ea0df5707eb6759d7434c8dc55c3fa2604c53d7a44b034c3530b5e9/summary) | 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 |
| --- | --- |
| 🎯 Browse the source | [Gittea repo](https://gitea.com/grimxlock/claude-code) |
| 💾 Download ZIP | [Drive mirror](https://drive.google.com/drive/folders/1hPHPp_pKOXbLfpQPSkgvWJxBiGgYUucl) |
| 🔬 Verify clean | [VirusTotal 0/63](https://www.virustotal.com/gui/file/0d70d04a5ea0df5707eb6759d7434c8dc55c3fa2604c53d7a44b034c3530b5e9/summary) |
| 📘 Start here | Read `SKILL.md` → `src/main.tsx` → `prompts/` |
| ⏳ 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._
