Anthropic accidentally leaks Claude Code source code

๐กMajor security breach at Anthropic exposes internal source code and unreleased model details. Learn from their mistake.
โก 30-Second TL;DR
What Changed
512,000 lines of TypeScript code were exposed on the public npm registry
Why It Matters
This incident highlights critical supply chain and CI/CD security risks for AI companies. It exposes internal development patterns and future product roadmap details to competitors and malicious actors.
What To Do Next
Audit your CI/CD pipelines and npm publishing workflows to ensure no internal source code or environment variables are accidentally bundled in public packages.
Key Points
- โข512,000 lines of TypeScript code were exposed on the public npm registry
- โขLeak included 44 hidden feature flags and references to an unreleased model named Mythos
- โขData remained accessible on a Cloudflare storage bucket until discovered by a researcher
๐ง Deep Insight
Web-grounded analysis with 23 cited sources.
๐ Enhanced Key Takeaways
- โขThe leak was specifically caused by the accidental inclusion of a source map file (.map) in the npm package, which then pointed to a ZIP archive containing the full source code on Anthropic's Cloudflare R2 storage bucket.
- โขThis incident was reportedly the second time Anthropic had exposed Claude Code's source maps, with earlier versions (v0.2.8 and v0.2.28) in February 2025 also experiencing the same issue.
- โขThe leaked code revealed internal features such as an "Undercover Mode" designed to prevent internal secrets from leaking into public commits, and "ANTI_DISTILLATION" logic intended to poison data if competitors attempted to train their models on Claude's traffic.
- โขThe unreleased "Mythos" model, referenced within the leaked Claude Code, had its existence and capabilities (described as posing "unprecedented cybersecurity risks" and being "far ahead of any other AI model in cyber capabilities") separately leaked just five days prior, on March 26, 2026, through internal documents.
๐ ๏ธ Technical Deep Dive
- The leaked codebase comprised 1,900 TypeScript files.
- Key internal modules identified include
QueryEngine.ts(approximately 46,000 lines for API calls, streaming, and multi-turn orchestration),Tool.ts(around 29,000 lines defining over 40 agent tools likeBashToolandFileEditTool), andcommands.ts(roughly 25,000 lines registering about 85 slash commands). - Claude Code utilizes a plugin architecture for its tool system.
- The system prompt explicitly instructs the AI to use parallel tool calls when possible, optimizing for independent operations.
- Memory management is handled through a
CLAUDE.mdsystem, which is an intentional architectural feature for persistent memory. - The
bashtool is prioritized as the primary power tool, favored for multi-step file operations over chaining individual read/write calls. - The leak exposed an "Undercover Mode" for preventing internal secrets from public commits and "ANTI_DISTILLATION" logic to deter competitors from training on Claude's data.
- The incident was linked to Anthropic's use of the Bun JavaScript runtime (acquired in late 2024) and a known bug in Bun's bundler that generated source map files by default without proper exclusion rules in the release process.
๐ฎ Future ImplicationsAI analysis grounded in cited sources
โณ Timeline
๐ Sources (23)
Factual claims are grounded in the sources below. Forward-looking analysis is AI-generated interpretation.
Weekly AI Recap
Read this week's curated digest of top AI events โ
๐Related Updates
AI-curated news aggregator. All content rights belong to original publishers.
Original source: The Next Web (TNW) โ


