Anthropic Exposed Claude Code Source via npm Package Source Map
Breach & Incident Intelligence · 25 sources · Updated 5mo ago · First seen Mar 31, 2026

Anthropic accidentally exposed the source code of its Claude Code CLI after publishing npm package version 2.1.88 with a large JavaScript source map that pointed to unobfuscated TypeScript files hosted in company-controlled storage. Researcher Chaofan Shou identified the issue, which exposed roughly 1,900 to 2,000 files and more than 512,000 lines of code before the package was removed. Anthropic said the incident was caused by a manual release-packaging error rather than an external intrusion, and stated that no customer data or credentials were leaked. The code was quickly mirrored and forked on GitHub, making containment difficult, while Anthropic later acknowledged that automation gaps in its deployment process contributed to the exposure.
Analysis of the leaked code revealed internal architecture and unreleased capabilities including KAIROS background autonomy, persistent memory features, multi-agent orchestration, hidden feature flags, undocumented commands, and controls intended to resist model distillation or disclosure of internal names. Security researchers warned that exposing Claude Code’s permission logic, trust boundaries, prompts, and execution pathways could help attackers craft jailbreaks, prompt-injection lures, malicious repositories, and persistence techniques against the tool. Anthropic’s response also drew scrutiny after a DMCA notice led GitHub to disable thousands of legitimate forks before the company asked for narrower enforcement, and the leak’s impact was compounded by reports of typosquatted npm packages and a separate compromised axios dependency affecting some npm installs during the same period.
Why it matters
Impact assessment
Anthropic Claude Code users, enterprises evaluating AI coding assistants, and security teams that permit the tool in developer environments are affected. The immediate impact is not customer-data loss but exposure of proprietary implementation details, trust boundaries, prompts, permission logic, and unreleased capabilities that can help attackers craft more effective prompt-injection, jailbreak, malicious repository, and persistence techniques against Claude Code deployments.
The exposure was broad and public rather than targeted. Anthropic states the incident was a release-packaging error in npm package version 2.1.88, not an external intrusion, and that no customer data, credentials, or model weights were leaked; however, the code was rapidly mirrored and forked on GitHub, making containment ineffective and creating lasting exposure.
Supporting details
- Affected product: @anthropic-ai/claude-code npm package, version 2.1.88.
- Affected population: developers and enterprises using Claude Code CLI in local development environments.
- Exposure scope: public internet exposure via npm source map and Anthropic-controlled Cloudflare R2 storage; mirrors spread widely on GitHub.
- Data reportedly exposed:
- Roughly 1,900 to 2,300 source files
- More than 500,000 lines of TypeScript
- Internal prompts, feature flags, tool definitions, orchestration logic, permission modes, and hidden commands
- Anthropic-reported non-exposed data:
- No customer data
- No credentials or API keys
- No model weights
- Business impact:
- Increased adversary understanding of Claude Code internals
- Competitive/IP loss from public source disclosure
- Enterprise trust and governance concerns around vendor release controls
- Potential downstream risk to organizations using Claude Code in sensitive repositories
- Known in-the-wild follow-on activity:
- GitHub mirrors and mass forking of leaked code
- Reported typosquatted npm packages targeting leaked internal package names
- Separate reported npm supply-chain risk involving trojanized axios versions during a narrow install window on March 31, 2026
- Containment complications:
- GitHub processed an overbroad DMCA action affecting about 8,100 forks before restoration of legitimate repositories
- Public redistribution and rewrites reduced practical ability to retract the code


