๐ŸŒStalecollected in 61m

Anthropic accidentally leaks Claude Code source code

Anthropic accidentally leaks Claude Code source code
PostLinkedIn
๐ŸŒRead original on The Next Web (TNW)

๐Ÿ’ก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.

Who should care:Developers & AI Engineers

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 like BashTool and FileEditTool), and commands.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.md system, which is an intentional architectural feature for persistent memory.
  • The bash tool 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

The leak will accelerate the development of competitive AI coding agents.
The exposed source code provides a detailed blueprint of Claude Code's internal architecture, tools, and agentic harness, enabling competitors to more easily understand and replicate its functionality.
Anthropic will face increased scrutiny regarding its internal security practices and AI safety claims.
The occurrence of two significant leaks (Claude Code source and Mythos internal documents) within a short period, both attributed to human error, raises questions about the company's operational security, particularly for a firm emphasizing AI safety.
The cybersecurity industry will face a growing challenge from AI-powered vulnerability discovery and exploitation.
The leaked details of the Mythos model, described as highly capable in finding and exploiting zero-day vulnerabilities, indicate a significant advancement in offensive AI capabilities that could overwhelm current defensive mechanisms.

โณ Timeline

2021
Anthropic founded by former OpenAI researchers.
2023-03
Claude 1 and Claude Instant models released via API.
2025-02
Claude Code launched as a research preview; an earlier version also had source maps exposed.
2026-03-26
Internal documents detailing the unreleased Claude Mythos model were accidentally leaked.
2026-03-31
Anthropic accidentally published Claude Code's entire source code to the public npm registry.
2026-04-07
Anthropic publicly disclosed Mythos and launched Project Glasswing, using the model to find software vulnerabilities.
๐Ÿ“ฐ

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) โ†—