The Claude Code Leak: Anthropic Accidentally Exposes 512,000 Lines of Internal AI Code

The incident occurred when Anthropic pushed version 2.1.88 of the @anthropic-ai/claude-code package to the public npm registry. Included in the bundle was a 60MB source map file (cli.js.map).

In web development, a source map is a “map” that translates compressed, unreadable production code back into its original, human-readable source. Because this file was left in the package, security researcher Chaofan Shou was able to reconstruct the entire TypeScript codebase.

The Scale of the Exposure

  • Total Files: ~1,906 proprietary source files.
  • Volume: Over 512,000 lines of strict TypeScript code.
  • Storage: The source map linked directly to a ZIP archive on Anthropic‘s own cloud storage, which was inadvertently left public.

What the Leaked Code Revealed

Beyond just “how it works,” the leak provided a literal roadmap of Anthropic’s secret features and future strategy:

1. The “Secret” Feature Flags

The code contained 44 feature flags, many for tools that haven’t been announced yet:

  • KAIROS: An “always-on” autonomous background agent. It’s designed to run in the background while the user is idle, performing “memory consolidation” and proactive bug fixing.
  • ULTRAPLAN: A sophisticated 30-minute remote planning system for complex architectural changes.
  • Voice Mode: Built-in support for voice commands directly in the terminal.
  • Undercover Mode: A controversial feature that prevents Claude from identifying itself as an AI or mentioning Anthropic codenames in Git commits (likely for “ghost-contributing” to open source).

2. Internal Codenames & Roadmap

The leak confirmed the internal names for the next generation of Claude models:

  • Capybara: The internal name for a Claude 4.6 variant.
  • Fennec: The codename for Opus 4.6/4.7.
  • Numbat: A new, unreleased model currently in internal testing.

3. The “Virtual Pet” Easter Egg

In a bizarre twist, engineers found a fully functional virtual pet system buried in the code—complete with 18 species, rarity tiers (like “shiny” variants), and stat tracking—likely an internal project for employee engagement.


Claude Code source code leak 2026

Why This Matters for The AI FlowHub Readers

  1. Prompt Engineering Insights: The leak exposed the System Prompts Anthropic uses to keep Claude Code “on track.” Studying these reveals how to write highly effective, goal-oriented prompts for your own agents.
  2. Tool Chaining Logic: We now know exactly how Anthropic orchestrates multiple “sub-agents” to solve a single problem. This is a blueprint for anyone building their own AI agents using frameworks like AgentScope.
  3. Security Transparency: The code revealed the “Security Bypass Prevention” logic, showing how Anthropic tries to stop the AI from executing dangerous commands (and where the weaknesses might be).

source : https://www.reddit.com/r/ClaudeCode/comments/1s62rji/claude_mythos_leak_a_new_capybaratier_model/