Important
This repository is a detailed documentation of the event where Anthropic accidentally leaked the full source code for its Claude Code CLI tool.
🇺🇸 English | 🇪🇸 Español | 🇧🇷 Português | 🇨🇳 中文 | 🇫🇷 Français | 🇩🇪 Deutsch | 🇯🇵 日本語 | 🇷🇺 Русский
On March 31, 2026, Anthropic inadvertently included a 59.8 MB source map file (cli.js.map) in the v2.1.88 release of the @anthropic-ai/claude-code package on the npm registry.
The leak was the result of a packaging error during the build process. Source maps are designed to map minified production code back to its original source for debugging; by including this file, Anthropic unknowingly provided the "blueprint" for their entire CLI architecture.
Analysis of the 1,902 proprietary files and 512,000 lines of TypeScript revealed:
- KAIROS Orchestration Engine: The "brain" of Claude Code. It handles advanced agentic behavior, tool-call loops, and complex state management that was previously thought to be handled entirely server-side.
- Undercover Mode: A stealth feature designed for Anthropic employees. It allows the agent to make git contributions (commits/PRs) without automatically tagging them as AI-generated, effectively masking the use of AI in open-source projects.
- autoDream (Self-Healing Memory): A sophisticated subsystem that activates during periods of user inactivity. It compresses past conversation context and "heals" its own memory to maintain maximum efficiency within the token window.
- Unreleased Model References: The code contains explicit calls to internal models like "Capybara" (Claude 4.6) and "Fennec" (Opus 4.6), suggesting these models were already in active testing.
The leak was first identified by security researcher Chaofan Shou (@Fried_rice) on X (Twitter).
Initial discovery by @Fried_rice on X, triggering the global community analysis.
| Path | Description |
|---|---|
source/ |
Reconstructed TypeScript source code from the v2.1.88 leak. |
assets/ |
Visual evidence and screenshots of the incident. |
- Primary Announcement: Chaofan Shou's Tweet
- Technical Analysis: CyberNews: Anthropic Claude Code Source Leak Explained
- Detailed Report: VentureBeat: Claude Code Source Leak Analysis
The code in the source/ directory is the proprietary intellectual property of Anthropic. This repository is for historical and educational documentation only. Unauthorized redistribution or commercial use of the leaked code may violate copyright laws and Anthropic's Terms of Service.
Generated with ❤️ to document a milestone in AI development history.