Claude Code Source Leaked via npm Packaging Error, Anthropic Confirms

Anthropic confirms Claude Code source was exposed via an npm packaging error. Here's what happened and how developers can protect their own packages.
Claude Code Source Code Exposed in npm Packaging Slip
Anthropic has confirmed that proprietary source code from Claude Code - their AI-powered coding assistant - was inadvertently exposed to the public via a misconfigured npm package. This is not a hack. No adversary needed to breach a firewall. A simple packaging misconfiguration did the damage.
That is the brutal reality of modern supply chain risk: one bad .npmignore or a misconfigured files field in package.json and your internal logic is shipping to every developer who runs npm install.
What Happened
- An npm package release associated with Claude Code included files that were never meant to be bundled for public distribution
- Anthropic confirmed the leak publicly, indicating the exposure was caught - but only after the package was already published and potentially cached across registries and mirrors
- Source code exposed in this manner can reveal proprietary algorithms, internal API structures, hardcoded credentials, and logic that helps attackers map out attack surfaces
The exact scope of what was included in the leaked bundle has not been fully disclosed, but even partial source exposure is a serious signal to threat actors scanning npm for intelligence.
Why This Keeps Happening
npm packaging is deceptively easy to misconfigure. The ecosystem gives you multiple ways to control what gets published - files in package.json, .npmignore, and .gitignore (used as fallback) - and they interact in ways that surprise even experienced maintainers.
Common mistakes include:
- Forgetting that
.gitignoredoes NOT apply if an.npmignoreexists - Using
filesallowlisting incorrectly and accidentally includingsrc/orlib/internals - Publishing from the repo root without a dedicated
dist/orbuild/output directory - Never running
npm pack --dry-runbefore an actual publish
How to Lock Down Your npm Releases
- Always run
npm pack --dry-runand inspect the tarball contents before publishing - Use explicit
filesallowlisting inpackage.json- whitelist only what consumers need - Keep secrets, internal configs, and source maps out of your build output
- Set up a CI gate that validates package contents automatically on every release
- Consider using tools like
publintorare-the-types-wrongto audit package structure - Rotate any credentials or tokens that may have been bundled - immediately
The Bigger Picture
If Anthropic - a well-resourced AI lab with security-conscious engineering teams - can ship a packaging error into production, so can your team. Supply chain hygiene is not optional in 2026. Every published package is a potential attack vector.
Is your app vulnerable to similar attacks? Run an automated scan in 3 minutes with VibeWShield.
Free security scan
Is your app vulnerable to similar attacks?
VibeWShield automatically scans for these and 18 other security checks in under 3 minutes.
Scan your app free