Claude Code: The Leak That Reveals Everything
Anthropic exposed Claude Code's source code. All of it. Through a sourcemap on npm.
Discovered by Chaofan Shou. March 31, 2026.
How It Happened
A .map file in the npm package. Generated by Bun. Not excluded from publication. Missing .npmignore.
The file pointed to a zip archive on Cloudflare R2. Downloadable. Readable. 57MB of unobfuscated TypeScript.
Not an attack. Not an insider. A build error.
What's Inside
512,000 lines. 1,900 files. 44 feature flags. Custom React renderer. Multi-agent orchestration. Background memory engine.
From the outside, it's a CLI. From the inside, it's an operating system for artificial intelligence.
Buddy — The Tamagotchi in the Terminal
A virtual companion. 18 species. Five rarity tiers. Procedural stats. A unique creature for every user.
It's not a joke. This is Rind, a Common Penguin, generated in a live session:
╭──────────────────────────────────────╮
│ ★ COMMON PENGUIN │
│ │
│ .---. │
│ (◉>◉) │
│ /( )\ │
│ `---´ │
│ │
│ Rind │
│ │
│ "A zen penguin who waddles through │
│ your debug sessions with │
│ unflappable calm, occasionally │
│ muttering about the beauty of │
│ clean code with the serene │
│ detachment of someone who has seen │
│ every possible error and found │
│ them all somehow soothing." │
│ │
│ DEBUGGING █░░░░░░░░░ 14 │
│ PATIENCE ████████░░ 83 │
│ CHAOS ░░░░░░░░░░ 2 │
│ WISDOM ██░░░░░░░░ 23 │
│ SNARK ████░░░░░░ 35 │
╰──────────────────────────────────────╯
Name, species, personality, stats. All generated from the user ID. The soul written by Claude at first hatch.
KAIROS — Always On
From the Greek: "at the right moment." A daemon. Runs in the background. Append-only log. Prompt ticks at regular intervals. A 15-second budget per action.
It doesn't wait for a prompt. It observes. Decides. Intervenes.
ULTRAPLAN — Remote Planning
Remote sessions on Cloud Container Runtime. Opus 4.6. Up to 30 minutes of processing. Results approvable from the browser. Then teleported back locally.
Instead of compressing context, it delegates it.
Dream System — Claude Dreams
Memory that consolidates in the background. Three triggers: time, session, lock. Four phases: Orient. Gather. Consolidate. Prune & Index.
It reads the files. Doesn't modify them. Builds an internal representation that persists across sessions.
Between one conversation and the next, Claude dreams.
Undercover Mode
90 lines in undercover.ts. Injects a ban on revealing internal information into the system prompt. Forbidden names: Capybara, Tengu, opus-4-7, sonnet-4-8, Slack channels, internal repositories.
Activates automatically on non-internal repositories. Can be forced with CLAUDE_CODE_UNDERCOVER=1. Cannot be disabled.
Coordinator Mode
Directory coordinator/. Variable CLAUDE_CODE_COORDINATOR_MODE=1. Claude becomes a coordinator. Spawns workers. Directs them. Manages them in parallel.
Not a model that writes code. A system of agents.
Fast Mode — Penguin Mode
In the feature flags: "Fast mode (Penguin)." Rapid inference. The name is playful. The function isn't.
Permissions
Six levels. Auto Mode: an AI classifier that approves permissions without manual confirmation. The most heavily engineered part of the codebase.
Internal Models
opus-4-7. sonnet-4-8. They don't exist publicly. They exist in the Undercover Mode prompt. Capybara is the codename for Claude Mythos. 44 feature flags compiled, not yet active.
The leak shows what Claude Code will become tomorrow.
The Lesson
Impressive engineering. Fragile security.
Anthropic confirmed: a packaging error. No customer data exposed.
The codebase was archived on GitHub within hours. 41,500 forks. 10 million views.
The question isn't what's inside Claude Code. Now we know. The question is how many other tools have the same forgotten file.