Anthropic’s Claude Code source leaked via npm map file

The 30-Second Skim
- What happened: Anthropic’s Claude Code AI assistant source code was unintentionally published in an npm package’s source map, prompting a rapid removal, security alerts, and a wave of exploitation attempts by threat actors.
- Key facts & numbers: Anthropic confirmed that internal code for its Claude Code AI coding assistant was released due to a human‑error packaging issue, and that no sensitive customer data or credentials were exposed. The npm package version 2.1.88 contained a source map file that exposed nearly 2,000 TypeScript files and more than 512,000 lines of Claude Code, and it has since been removed from npm. Security researcher Chaofan Shou first flagged the leak on X, where the post gathered over 28.8 million views; the code is now hosted on a public GitHub repo with over 84,000 stars and 82,000 forks.
- What happens next: The leak isn’t just a code snoop—hackers already weaponized it, pushing trojan npm packages and fake repos that drop Vidar and GhostSocks.
- Anthropic confirmed that internal code for its Claude Code AI coding assistant was released due to a human‑error packaging issue, and that no sensitive customer data or credentials were exposed.
- The npm package version 2.1.88 contained a source map file that exposed nearly 2,000 TypeScript files and more than 512,000 lines of Claude Code, and it has since been removed from npm.
- Security researcher Chaofan Shou first flagged the leak on X, where the post gathered over 28.8 million views; the code is now hosted on a public GitHub repo with over 84,000 stars and 82,000 forks.
- The leaked code reveals internal components such as a self‑healing memory architecture, a tools system, a query engine, multi‑agent orchestration, a bidirectional communication layer, the KAIROS persistent background agent, a “dream” mode, an Undercover Mode for stealth contributions, and anti‑distillation attack defenses.
Why It Matters
Developers and enterprises using Claude Code now face heightened risk of malicious code execution, while Anthropic’s reputation and product security are jeopardized; the leak also supplies competitors with a detailed blueprint of the model’s architecture and triggers supply‑chain concerns, as users who updated the npm package on March 31 may have installed a trojanized HTTP client, prompting downgrades and secret rotation.
Sources Cited
- The Hacker News — Claude Code Source Leaked via npm Packaging Error, Anthropic Confirms
- qz.com — Anthropic accidentally leaked its own source code for Claude Code
- Venturebeat — 512,000 lines of leaked AI agent source code, three mapped attack paths, and the audit security leaders need now
- PCWorld — Anthropic leaked its own Claude Code source code by mistake
- AI Magazine — Claude Code Leak: What Went Wrong at Anthropic?
Related Coverage
Ask SkimNews