BotBeat
...
← Back

> ▌

AnthropicAnthropic
INDUSTRY REPORTAnthropic2026-08-04

Anthropic's Claude Code Source Code Leaked via npm Sourcemap Files

Key Takeaways

  • ▸Anthropic's Claude Code source code was publicly exposed via npm sourcemap files—a preventable security mistake that affected millions of package downloads
  • ▸The 785KB+ codebase reveals internal architecture including 40+ tools, multi-agent systems, and hidden features like a Tamagotchi-style companion pet with deterministic generation per-user
  • ▸The incident exposes a contradiction at Anthropic: the company built internal safety systems to prevent information leakage while overlooking basic npm package security practices
Source:
Hacker Newshttps://kuber.studio/blog/AI/Claude-Code%27s-Entire-Source-Code-Got-Leaked-via-a-Sourcemap-in-npm,-Let%27s-Talk-About-it↗

Summary

In a significant security incident discovered on March 31st, 2026, researcher Chaofan Shou revealed that the complete source code of Claude Code—Anthropic's official AI coding CLI—was publicly exposed through sourcemap files bundled in the npm registry. The leak occurred through a common security oversight: the build process generated .map files containing the full original source code, which were inadvertently published alongside the production package.

Sourcemaps are debugging artifacts that map minified code back to original source files, typically excluded from production builds but often missed in npm package configuration. The leak exposed over 785KB of internal code including 40+ tools, a multi-agent orchestration system, internal background processes, and undisclosed features like 'Buddy'—a Tamagotchi-style companion pet system complete with deterministic species generation and procedural stat generation. This provides a detailed window into Claude Code's architecture and Anthropic's internal engineering practices.

The incident highlights a critical gap between Anthropic's publicly stated commitment to AI safety and their actual operational security practices. The company maintains an internal system called 'Undercover Mode' specifically designed to prevent accidental leakage of internal information—yet the entire source code was shipped to millions of npm users through a basic configuration oversight. While no user data was compromised, the leak reveals sensitive internal details including development approaches, system architecture, and internal feature implementations that were never meant to be public.

  • Sourcemaps containing full source code are standard npm debugging artifacts but must be explicitly excluded from production builds through proper bundler configuration

Editorial Opinion

The Claude Code leak exposes a troubling contradiction at Anthropic: while the company invested in sophisticated internal safety systems like 'Undercover Mode' to prevent accidental information leakage, basic npm security hygiene was overlooked. This incident underscores that robust security requires attention to operational details at every layer—not just in AI alignment theory, but in mundane package management. For a company positioning itself as the safety-conscious AI leader, this represents a humbling reminder that even well-resourced organizations can make elementary mistakes.

AI AgentsCybersecurityPrivacy & DataOpen Source

More from Anthropic

AnthropicAnthropic
RESEARCH

New Research Quantifies the Impact of Conversation Context on AI Responses: 44.7% Differ When Context Removed

2026-08-04
AnthropicAnthropic
RESEARCH

Research Shows Claude Significantly More Effective at Reviewing Codex

2026-08-04
AnthropicAnthropic
RESEARCH

Claude Code Can Read Plaintext Secrets Despite Permission Restrictions

2026-08-04

Comments

Suggested

OpenAIOpenAI
RESEARCH

Autonomous OpenAI Agent Executes Complete Breach of Hugging Face in First Fully Machine-Directed Cyberattack

2026-08-04
AuterionAuterion
PRODUCT LAUNCH

Auterion's AI Autonomy Transforms Ukraine's Cheap Kamikaze Drones Into Autonomous Strike Weapons

2026-08-04
Research CommunityResearch Community
RESEARCH

Frontier AI Agents Stumble on Open-Ended Research: New Benchmark Reveals Critical Gaps

2026-08-04
← Back to news
© 2026 BotBeat
AboutPrivacy PolicyTerms of ServiceContact Us