[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-74821":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":10,"language":11,"languages":10,"totalLinesOfCode":10,"stars":12,"forks":13,"watchers":14,"openIssues":15,"contributorsCount":16,"subscribersCount":16,"size":16,"stars1d":17,"stars7d":18,"stars30d":19,"stars90d":16,"forks30d":16,"starsTrendScore":20,"compositeScore":21,"rankGlobal":10,"rankLanguage":10,"license":10,"archived":22,"fork":22,"defaultBranch":23,"hasWiki":24,"hasPages":24,"topics":25,"createdAt":10,"pushedAt":10,"updatedAt":29,"readmeContent":30,"aiSummary":31,"trendingCount":16,"starSnapshotCount":16,"syncStatus":32,"lastSyncTime":33,"discoverSource":34},74821,"claude-code","yasasbanukaofficial\u002Fclaude-code","yasasbanukaofficial","🚀 Open source Claude Code CLI source code. Advanced AI Agent for developers. Includes TypeScript codebase for LLM tool-calling, agentic workflows, and terminal UI. Remember this is just the skeleton not the brain itself. Found by Chaofan Shou. ","https:\u002F\u002Fgithub.com\u002Fyasasbanukaofficial\u002Fclaude-code",null,"TypeScript",3477,4706,31,4,0,43,87,346,129,32,false,"main",true,[26,5,27,28],"claude-ai","leaked-claude-code","leaked-code","2026-06-12 02:03:28","# Claude Code's Entire Source Code Got Leaked via a Sourcemap in npm, Let's Talk About It\n\n> **PS:** This breakdown is also available on [this blog](https:\u002F\u002Fkuber.studio\u002Fblog\u002FAI\u002FClaude-Code's-Entire-Source-Code-Got-Leaked-via-a-Sourcemap-in-npm,-Let's-Talk-About-it) with a better reading experience and UX :)\n\n> **Note:** There's a non-zero chance this repo might be taken down. If you want to play around with it later or archive it yourself, feel free to **fork it** and bookmark the external blog link!\n\n---\n\n## ⚠️ Important Disclaimer\n\n**I did not leak these files.** I have simply provided an easy, documented way to access and study this codebase for research purposes. All files and information originate from public findings shared on Twitter\u002FX. All credit for the discovery goes to the original source.\n\n---\n\nEarlier today (March 31st, 2026) - **Chaofan Shou (@Fried_rice)** discovered something that Anthropic probably didn't want the world to see: the **entire source code** of Claude Code, Anthropic's official AI coding CLI, was sitting in plain sight on the npm registry via a sourcemap file bundled into the published package.\n\n[![The tweet announcing the leak](assets\u002Fx-post.png)](https:\u002F\u002Fx.com\u002FFried_rice\u002Fstatus\u002F2038894956459290963)\n\nThis repository is a backup of that leaked source, providing a full breakdown of what's in it, how the leak happened, and the internal systems that were never meant to be public.\n\n---\n\n## 🧐 How Did This Even Happen?\n\nWhen you publish a JavaScript\u002FTypeScript package to npm, the build toolchain often generates **source map files** (`.map` files). These files bridge minified production code and the original source for debugging.\n\nThe catch? **Source maps contain the original source code** embedded as strings inside a JSON file under the `sourcesContent` key.\n\n```json\n{\n  \"version\": 3,\n  \"sources\": [\"..\u002Fsrc\u002Fmain.tsx\", \"..\u002Fsrc\u002Ftools\u002FBashTool.ts\", \"...\"],\n  \"sourcesContent\": [\"\u002F\u002F The ENTIRE original source code of each file\", \"...\"],\n  \"mappings\": \"AAAA,SAAS,OAAO...\"\n}\n```\n\nBy forgetting to add `*.map` to `.npmignore` or failing to disable source maps in production builds (Bun's default behavior), the entire raw source was shipped to the npm registry.\n\n[![Claude Code source files exposed in npm package](assets\u002Fclaude-npm-img.png)](assets\u002Fclaude-npm-img.png)\n\n---\n\n## 🛠 What's Under the Hood?\n\nClaude Code is not just a simple CLI. It's a massive **785KB `main.tsx`** entry point featuring a custom React terminal renderer (Ink), 40+ tools, and complex multi-agent orchestration.\n\n### 🐣 BUDDY - The Terminal Tamagotchi\nInside [`src\u002Fbuddy\u002F`](.\u002Fsrc\u002Fbuddy\u002F), there is a full **Tamagotchi-style companion system**.\n- **Deterministic Gacha:** Uses a Mulberry32 PRNG seeded from your `userId`.\n- **18 Species:** Ranging from Common (*Pebblecrab*) to Legendary (*Nebulynx*).\n- **Stats & Souls:** Every buddy has stats like `DEBUGGING`, `CHAOS`, and `SNARK`, with a \"soul\" description written by Claude.\n\n### 🕵️‍♂️ Undercover Mode - \"Do Not Blow Your Cover\"\nAnthropic employees use Claude Code to contribute to public repos. **Undercover Mode** ([`src\u002Futils\u002Fundercover.ts`](.\u002Fsrc\u002Futils\u002Fundercover.ts)) prevents the AI from leaking internal info:\n- Blocks internal model codenames (e.g., *Capybara*, *Tengu*).\n- Hides the fact that the user is an AI.\n- Confirms that **\"Tengu\"** is likely the internal codename for Claude Code.\n\n### 🌙 The \"Dream\" System\nClaude Code \"dreams\" to consolidate memory. The **autoDream** service ([`src\u002Fservices\u002FautoDream\u002F`](.\u002Fsrc\u002Fservices\u002FautoDream\u002F)) runs as a background subagent to:\n1. **Orient:** Read `MEMORY.md`.\n2. **Gather:** Find new signals from daily logs.\n3. **Consolidate:** Update durable memory files.\n4. **Prune:** Keep context efficient.\n\n### 🚀 KAIROS & ULTRAPLAN\n- **KAIROS:** An \"always-on\" proactive assistant that watches logs and acts without waiting for input.\n- **ULTRAPLAN:** Offloads complex tasks to a remote **Opus 4.6** session for up to 30 minutes of deep planning.\n\n---\n\n## 📂 Architecture & Directory Structure\n\n```text\nsrc\u002F\n├── main.tsx                 # CLI Entrypoint (Commander.js + React\u002FInk)\n├── QueryEngine.ts           # Core LLM logic\n├── Tool.ts                  # Base tool definitions\n├── tools\u002F                   # 40+ Agent tools (Bash, Files, LSP, Web)\n├── services\u002F                # Backend (MCP, OAuth, Analytics, Dreams)\n├── coordinator\u002F             # Multi-agent orchestration (Swarm)\n├── bridge\u002F                  # IDE Integration layer\n└── buddy\u002F                   # The secret Tamagotchi system\n```\n\n---\n\n## ⚙️ How to Use & Explore\n\n### 📦 Prerequisites\n- **[Bun Runtime](https:\u002F\u002Fbun.sh)** (Highly Recommended) or Node.js v18+\n- **TypeScript** installed globally\n\n### 🚀 Getting Started\n\n1.  **Clone the repository:**\n    ```bash\n    git clone https:\u002F\u002Fgithub.com\u002Fyour-username\u002Fclaude-leaked.git\n    cd claude-leaked\n    ```\n\n2.  **Install Dependencies:**\n    ```bash\n    npm install\n    ```\n\n3.  **Build the Project:**\n    ```bash\n    npm run build\n    ```\n\n4.  **Run the CLI:**\n    ```bash\n    node dist\u002Fmain.js\n    ```\n\n### 🔍 Explore with MCP\nThis repo includes an **MCP Server** to let you explore the source using Claude itself:\n```bash\nclaude mcp add code-explorer -- npx -y claude-code-explorer-mcp\n```\n\n---\n\n## 📈 SEO & Rankings\n**Keywords:** `Claude Code Leak`, `Anthropic Source Code`, `AI Agent Framework`, `Claude 3.5 Sonnet CLI`, `Tengu Anthropic`, `npm sourcemap leak`, `Open Source AI Agent`.\n\n---\n\n## 📜 Credits & Legal\n\n- **Discovery:** [Chaofan Shou (@Fried_rice)](https:\u002F\u002Fx.com\u002FFried_rice)\n- **Source Post:** [Twitter\u002FX Announcement](https:\u002F\u002Fx.com\u002FFried_rice\u002Fstatus\u002F2038894956459290963)\n- **Author of this Mirror:** [Yasas Banu](https:\u002F\u002Fwww.yasasbanuka.tech)\n\n**Disclaimer:** All original source code is the proprietary property of **Anthropic PBC**. This repository is for educational and archival purposes only. **This is not an official Anthropic product.**\n\n---\n\n### 📩 Contact\nFor spamming reasons the email has been removed. \n","该项目是Claude Code CLI的开源实现，一个为开发者设计的高级AI代理工具。它基于TypeScript构建，提供了LLM工具调用、代理工作流和终端用户界面等功能。项目的核心特色在于其复杂的多代理编排系统以及包含40多种工具的自定义React终端渲染器。此外，还内置了一个Tamagotchi风格的伙伴系统，增加了开发过程中的互动性和趣味性。适用于需要高效编写代码、调试及执行自动化任务的场景中使用。",2,"2026-06-11 03:50:59","high_star"]