![]() |
VOOZH | about |
The news is confirmed: on March 31, 2026, the entire source code of Claude Code, Anthropic's flagship AI coding tool, ended up online due to a source map file accidentally included in the npm package. 512,000 lines of TypeScript, 1,900 files, and a series of embarrassing discoveries for a company that presents itself as the most security-conscious in the AI industry.
The most surprising part? This is the third time Anthropic has made the same mistake with source maps in the npm registry.
At 4:23 AM (ET) on March 31, Chaofan Shou (@Fried_rice on X), a security researcher at Solayer Labs, discovered that version 2.1.88 of the @anthropic-ai/claude-code package on the npm registry contained a source map file (cli.js.map) weighing 59.8 MB.
.map files are normally used for debugging: they link compiled and minified code back to the original source. But this file pointed directly to a zip archive hosted on Anthropic's Cloudflare R2 storage, downloadable without any authentication.
The technical cause: Claude Code is built with the Bun runtime (which Anthropic acquired in late 2024). With Bun's bundler, source maps are generated by default unless explicitly disabled. A documented bug (oven-sh/bun#28001) reports exactly this issue.
The archive contained 1,900 TypeScript files with over 512,000 lines of code. This is not the AI model itself (no weights, no training data), but the entire CLI client layer that developers install and use daily.
The undercover.ts module is perhaps the most controversial discovery. When activated (via CLAUDE_CODE_UNDERCOVER=1), it instructs the model to remove every trace of its AI origin from Git commit messages in public repositories. Code names like "Capybara" or "Tengu", internal Slack channels, and even the phrase "Claude Code" are systematically stripped out.
Critical detail: There is no way to forcibly disable this feature. Once enabled, it protects against leaking model code names. This raises ethical concerns: AI commits in open source repositories that appear to have been written by humans.
References scattered throughout the code reveal KAIROS, a not-yet-public autonomous agent mode that includes:
The code reveals sophisticated anti-distillation mechanisms designed to prevent competitors from copying the model by intercepting API traffic:
ANTI_DISTILLATION_CC flag is active, fake tool definitions are injected into system prompts, poisoning competitors' training dataThe file userPromptKeywords.ts contains a regex that detects user frustration by looking for profanity and angry expressions. The irony was lost on no one: an AI company using regex instead of model inference for sentiment analysis. A pragmatic choice, however: fast, cheap, and with no latency.
buddy/companion.ts implements a Tamagotchi-style virtual pet system with 18 species, rarity levels, "shiny" variants (1% probability), and RPG stats like "DEBUGGING" and "SNARK". Species names are encoded with String.fromCharCode() to evade automated code checks. Likely an easter egg from the development team.
The leak confirms the internal model roadmap:
Important note: Internal comments reveal that Anthropic is already on version 8 of Capybara, but the model still has a false claims rate of 29-30% in v8, a regression compared to 16.7% in v4.
An Anthropic spokesperson told The Register:
"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 are implementing measures to prevent this from happening again."
This leak comes just days after another incident in which Anthropic had made public nearly 3,000 files, including a blog post draft describing a powerful upcoming model known internally as "Mythos" and "Capybara".
As reported by Fortune, this is the third time Anthropic has accidentally published source maps in npm packages, despite actively pursuing takedowns against reverse engineering attempts.
Within a few hours of the discovery:
Containment is now practically impossible.
The leak also revealed some less flattering aspects:
No. No model weights, training data, or core intelligence were exposed. The leak exclusively concerns the CLI client layer: the terminal tool that developers install and use locally.
No, according to Anthropic. The official statement confirms that no sensitive customer data or credentials were involved. The leak concerns the application source code, not user data.
A .map file included by mistake. Version 2.1.88 of the npm package contained a 59.8 MB source map file pointing to the source code archive on Anthropic's Cloudflare R2 storage, downloadable without authentication.
The Bun bundler generates source maps by default. A documented bug (oven-sh/bun#28001) indicates that source maps are served in production despite the documentation saying otherwise. A single misconfigured .npmignore file or files field in package.json can expose everything.
A module that hides the AI origin of commits. When activated, it instructs the model to remove all references to Anthropic, model code names, and the phrase "Claude Code" from commit messages in public repositories. There is no way to forcibly disable it.
An unreleased feature. KAIROS is an autonomous agent mode that includes memory consolidation during user inactivity, daily logs, and GitHub webhook integration. It represents the future roadmap of Claude Code.
Hard to say. The code is now public domain with over 41,500 forks on GitHub. Some in the community suggest Anthropic should embrace open source, but the company has historically pursued takedowns against reverse engineering.
This leak is a perfect paradox: the AI company that positions itself as the most security-conscious exposes its own source code for the third time with the exact same mistake.
.npmignore would have prevented all of this. Three times overThe news is real and confirmed by Anthropic itself. The code is now public and unrecoverable. The real question now is: will Anthropic learn from the third time?
Do you have questions about this leak or its implications for developers using Claude Code? Use the contact form below to write to me.
Subscribe to the newsletter to receive new articles directly in your inbox.
Subscribe to the newsletter to receive new articles directly in your inbox.
3.4k readers worldwide, every Saturday