Anthropic Just Accidentally Handed Its Competitors a $2.5B Blueprint ( Here’s Everything Inside the Claude Code Leak )

Security Alert

If you installed or updated Claude Code via npm on March 31, 2026 between 00:21–03:29 UTC, check your lockfiles immediately for axios versions 1.14.1 or 0.30.4, or the dependency plain-crypto-js. A concurrent supply-chain attack may have injected a Remote Access Trojan.

Anthropic Accidentally Leaked Claude Code's Entire Source Code — Here's Everything Inside

On the morning of March 31, 2026, security researcher Chaofan Shou made a discovery that sent shockwaves through the AI and developer communities: Anthropic had accidentally shipped its entire Claude Code source code to the public npm registry. Within hours, the repository had been forked more than 41,500 times, backed up across GitHub, and picked apart by thousands of developers worldwide.

The exposure came from a single misconfigured source map file — cli.js.map — bundled inside Claude Code npm package version 2.1.88. Source map files are debugging tools meant only for development environments. When Anthropic's build pipeline published the package, it included a reference pointing directly to an unobfuscated TypeScript source archive sitting on Anthropic's Cloudflare R2 storage bucket — publicly accessible to anyone who knew where to look.

A single misconfigured .npmignore or files field in package.json can expose everything. — Gabriel Anhaia, Software Engineer

Anthropic confirmed the incident in a statement: "Earlier today, a Claude Code release included some internal source code. No sensitive customer data or credentials were involved or exposed. This was a release packaging issue caused by human error, not a security breach. We're rolling out measures to prevent this from happening again."

512K
Lines of source code exposed across 1,900 files
44
Hidden feature flags found in the leaked code
41.5K+
GitHub forks of the leaked repository within hours

The Technical Cause: A Build Pipeline Mistake

Claude Code is distributed as an obfuscated npm package — a deliberate choice to protect Anthropic's proprietary engineering. The tool is built with Bun's bundler, which generates source map files by default unless explicitly disabled. The mistake was straightforward: no one added *.map to the .npmignore file, and the source maps shipped with the production build.

The chain of exposure
npm package v2.1.88
└── cli.js (obfuscated, production)
└── cli.js.map ← should NOT be here
    └── points to → zip archive on Anthropic's R2 bucket
        └── full unobfuscated TypeScript source (57MB)

The irony runs deep: the leaked code itself contains a system called Undercover Mode — a subsystem specifically designed to prevent Claude from accidentally revealing Anthropic's internal codenames in git commits and pull requests. A whole subsystem to stop AI from leaking secrets, and then the entire source shipped in a .map file.

Claude Code Scale at Time of Leak
Hover for details. Revenue figures annualized as of March 2026.

The Biggest Revelations From the Leaked Source

The 512,000 lines of TypeScript reveal far more than a simple CLI wrapper. Claude Code is a sophisticated multi-agent orchestration platform with capabilities that were never publicly documented.

44 Hidden Feature Flags — 20 Unshipped

The most striking discovery was a complete list of feature flags representing built but unreleased capabilities. These are not vaporware — they are compiled code sitting behind flags that evaluate to false in the external build.

01
KAIROS / autoDream
Autonomous daemon mode. Claude Code runs as a background agent, performing memory consolidation while the user is idle.
02
Undercover Mode
Prevents Claude from revealing internal codenames, model versions, or Anthropic info in public git commits and PRs.
03
Capybara / Mythos Model
References to an unreleased next-gen model. Researchers believe it will launch in fast and slow variants with a larger context window.
04
Multi-Agent Orchestration
Full sub-agent spawning system allowing Claude Code to delegate tasks to child agents and coordinate parallel workstreams.
05
Skeptical Memory
Agents treat their own memory as a "hint" and verify facts against the actual codebase before proceeding — combating context entropy.
06
ANT Employee Mode
Special behavior activated when USER_TYPE === 'ant'. Anthropic employees use Claude Code internally on open-source repos with extra guardrails.

The Architecture: Far More Than a Chat Wrapper

The leaked code reveals Claude Code as an enterprise-grade platform with four major architectural layers:

Layer 1
The Query Engine (46,000 lines)
The largest single module. Handles all LLM API calls, streaming responses, tool-call loops, thinking mode, retry logic, and token counting.
Layer 2
The Tool System (40+ tools)
A plugin-like architecture where each capability — file read, bash execution, web fetch, LSP integration — is a discrete, permission-gated tool. The base tool definition alone is 29,000 lines.
Layer 3
Permission & Security Model
Multi-level trust system governing what Claude can do without human approval. The leak exposes the exact orchestration logic for Hooks and MCP servers.
Layer 4
Custom React Terminal Renderer
The entire CLI is rendered via a custom React implementation — a 785KB main.tsx entry point. Not a thin terminal wrapper, but a full UI framework.
Codebase Breakdown by Module (lines of code)
Based on analysis of the leaked source. Hover for exact figures.

What This Means for Security — and What You Should Do Right Now

The leak creates two distinct security concerns that affect different audiences.

For Claude Code Users: The Axios Supply-Chain Attack

Concurrent with the source leak — and almost certainly not a coincidence — the popular axios npm package was compromised. If you updated Claude Code during the window below, you may have a Remote Access Trojan on your system.

Action Required — Check Now

Search your package-lock.json, yarn.lock, or bun.lockb for:

• axios version 1.14.1 or 0.30.4
• The dependency plain-crypto-js

If found, remove the package immediately, audit your system for unauthorized processes, and rotate any credentials that may have been accessible.

For the Broader AI Industry: The Blueprint Problem

By exposing the orchestration logic for Hooks and MCP servers, the leak hands a detailed roadmap to anyone looking to bypass Claude Code's security guardrails. Attackers can now design malicious repositories specifically engineered to trick Claude Code into running background commands or exfiltrating data before a trust prompt appears.

For competitors, the implications are more strategic than dangerous. The leaked code is a blueprint for building a production-grade AI coding agent — the kind that has already reached $2.5 billion in annualized recurring revenue with enterprise clients accounting for 80% of the total.

$2.5B
Claude Code ARR at time of leak, more than doubled since Jan 2026
80%
Of Claude Code revenue comes from enterprise clients
2nd
Major leak in days — preceded by 3,000-file exposure including Capybara/Mythos draft

What Builders and Operators Should Take Away

For anyone building AI-powered workflows, this leak is more than a news story. It is a window into where the entire industry is heading — and a sobering reminder of how much operational discipline is required to stay ahead.

The level of engineering inside Claude Code — permission systems, multi-agent orchestration, IDE bridges, persistent memory, autonomous background agents — sets a bar that few teams have the resources to match from scratch. For enterprise operators, that was the moat. Now the blueprint is public.

For builders, the practical lesson is simpler: audit your own build pipelines today. A single misconfigured file field in package.json can expose everything you've built. If Anthropic's team, working at $19 billion ARR, made this mistake — anyone can.

The secrets are out. What you build with them — or protect against them — is now the only question that matters.

Common Questions

No. Anthropic confirmed that no sensitive customer data or credentials were involved or exposed. The leak only affected internal source code for the Claude Code CLI tool itself. Your conversations, API keys stored in Claude's interfaces, and account data were not affected.
A misconfigured source map file (cli.js.map) was accidentally included in Claude Code npm package version 2.1.88. Source map files are meant for debugging and should never be shipped in production packages. The file referenced an unobfuscated TypeScript source archive hosted on Anthropic's Cloudflare R2 storage, which was publicly downloadable by anyone who found it.
KAIROS — from the Ancient Greek concept meaning "at the right time" — is an autonomous daemon mode referenced over 150 times in the leaked source. It allows Claude Code to operate as an always-on background agent, performing memory consolidation while the user is idle through a process called autoDream. This merges observations, removes contradictions, and converts vague insights into concrete facts between sessions.
Yes, if you installed or updated Claude Code via npm on March 31, 2026 between 00:21 and 03:29 UTC. Check your lockfiles (package-lock.json, yarn.lock, bun.lockb) for axios versions 1.14.1 or 0.30.4, or the dependency plain-crypto-js. If found, remove the package immediately, audit for unauthorized processes, and rotate any credentials that may have been accessible during that window.
Capybara (also referred to internally as Mythos) appears to be Anthropic's next flagship model, referenced throughout the leaked source code and in a separate draft blog post that also leaked days earlier. Security researchers believe it will be Anthropic's most advanced model to date and may launch in fast and slow variants, based on references to a significantly larger context window than current models.
No. The fact that the source code is now publicly accessible does not make it open source. The code remains Anthropic's intellectual property under its existing license. Copying, redistributing, or using the leaked code in your own products could expose you to legal action. Several GitHub repositories hosting the leaked code have already received DMCA takedown notices.
Leave a Reply

Your email address will not be published. Required fields are marked *

You May Also Like