What the Claude Code Leak Reveals: 510k Lines of AI Engine Exposed
A massive leak of Anthropic’s Claude Code exposed over 1,900 files and 510,000 lines of TypeScript, revealing its React‑Ink UI, Bun runtime, extensive toolset, hidden Kairos mode, electronic pet system, and covert Undercover features, sparking worldwide developer frenzy and security concerns.
Leak Overview
In a recent npm publishing error, the source map file cli.js.map (≈59.8 MB) was included in the public package @anthropic-ai/claude-code. This exposed the complete Claude Code CLI source code.
Repository: https://github.com/instructkr/claude-code Size: more than 1,900 files, ~510,200 lines of TypeScript (≈51 MB).
Technology Stack
Runtime: Bun JavaScript runtime.
UI: React + Ink for terminal interface.
Package: Published to npm under @anthropic-ai/claude-code.
Core Components
Tools – a toolbox of more than 40 independent modules providing file I/O, Bash command execution, built‑in LSP integration and sub‑agent generation.
QueryEngine.ts – a ~46 k‑line engine that implements reasoning logic, token counting and complex “thought‑chain” loops.
Coordinator & Bridge – modules named coordinator and bridge that enable multi‑agent coordination and IDE integration (VS Code / JetBrains).
Hidden / Undocumented Features
Kairos mode – an unreleased mode identified by the codename “Kairos”.
Buddy System – an embedded electronic‑pet subsystem with 18 species, rarity tiers, shiny variants and detailed stats.
Undercover Mode – automatically erases AI‑related traces from commit history when Anthropic staff work in public repositories; cannot be disabled manually.
Coordinator Mode – allows Claude to schedule parallel subordinate agents for higher throughput.
Auto Mode – an AI classifier that automatically approves tool permissions, removing manual prompt confirmations.
Security Implications
The source map exposed internal logic, engineering decisions and proprietary mechanisms of Anthropic’s AI‑engineering platform, giving competitors detailed insight into the implementation of the Claude Code assistant.
Reproduction Steps
Clone the repository: git clone https://github.com/instructkr/claude-code.git Inspect the cli.js.map file to view the original TypeScript source mapping.
Run the CLI with Bun: bun run src/cli.ts (or the compiled entry point).
Architecture Diagram
Java Architect Essentials
Committed to sharing quality articles and tutorials to help Java programmers progress from junior to mid-level to senior architect. We curate high-quality learning resources, interview questions, videos, and projects from across the internet to help you systematically improve your Java architecture skills. Follow and reply '1024' to get Java programming resources. Learn together, grow together.
How this landed with the community
Was this worth your time?
0 Comments
Thoughtful readers leave field notes, pushback, and hard-won operational detail here.
