Anthropic's Claude Code Leaked: 1,900 Files, 512,000 Lines

Claude Code source code leaked, here's what's inside Today, Anthropic's Claude Code CLI had its full source leaked via a .map file left in their npm package. The source map pointed to a zip on their R2 bucket with the entire unobfuscated TypeScript source. I backed up the code and dug through it with Opus 4.6: - ~1,900 files, 512,000+ lines of TypeScript - ~40 agent tools, ~90 slash commands, ~35 services - Built on Bun + React/Ink for terminal UI - Multi-agent swarm orchestration (agents working in parallel across tmux/iTerm panes) - IDE bridge for VS Code and JetBrains - Full vim mode, voice input, persistent memory system - Compile-time dead code elimination via Bun feature flags - OpenTelemetry telemetry pipeline - A hidden Easter egg: deterministic companion creatures (ducks, axolotls, capybaras) with rarities from common to legendary Some standout engineering choices: parallel startup prefetch saving ~65ms on every boot, feature-flag gated module stripping so internal-only tools never ship to public users, and a tool-use loop architecture where the QueryEngine handles streaming, retries, token budgets, and file state snapshots for undo. Serious piece of engineering. Worth studying. GitHub: https://lnkd.in/gTdxXf2b Credit: Chaofan Shou (@Fried_rice on X) for the original discovery.

To view or add a comment, sign in

Explore content categories