Skip to main content
Mallory
← Back to News
leaked-secret-api-keybuild-pipeline-compromisepackage-repository-poisoningai-platform-security

Anthropic Exposed Claude Code Source via npm Package Source Map

Breach & Incident Intelligence · 25 sources · Updated 5mo ago · First seen Mar 31, 2026

Anthropic Exposed Claude Code Source via npm Package Source Map

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
Is this vendor in your chain?See attribution, scope, and your downstream exposure.
Check the blast radius
Event timeline

How this story unfolded

Events from the most recent confirmed update back to the earliest known activity.

10 events · Mar 31, 2026 – Apr 2, 2026
  1. Apr 2, 20268mo ago

    Anthropic asks GitHub to narrow DMCA enforcement to 96 URLs

    After developer complaints, Anthropic asked GitHub to limit enforcement to the 96 fork URLs specifically listed in the notice and to restore other repositories disabled by network-wide processing. Anthropic representatives said the broader removals were unintentional and resulted from a communication mistake.

    Anthropic says its leak-focused DMCA effort unintentionally hit legit GitHub forks - Ars Technica
  2. Apr 2, 20268mo ago

    Broad GitHub DMCA action disables about 8,100 repositories

    GitHub removed a network of about 8,100 similar forked repositories after a leak-related DMCA submission alleged the forks were infringing to the same extent as the parent repository. Many affected repositories reportedly did not contain leaked Claude Code material.

    Anthropic says its leak-focused DMCA effort unintentionally hit legit GitHub forks - Ars Technica
  3. Apr 1, 20268mo ago

    Anthropic says manual deploy step was automated after the leak

    Anthropic disclosed that the incident stemmed from a manual deployment step that should have been better automated. The company said it implemented automation improvements to prevent a recurrence.

    ‘There was a manual deploy step that should have been better automated’: Claude Code creator confirms cause of massive source code leak | IT Pro
  4. Apr 1, 20268mo ago

    Anthropic removes the affected npm package within hours

    Anthropic pulled the exposed Claude Code npm package within hours of the leak being discovered. By that point, mirrors had already propagated the source code broadly online.

    Inside Claude Code's leaked source: swarms, daemons, and 44 features Anthropic kept behind flags - The New Stack
  5. Apr 1, 20268mo ago

    Anthropic confirms leak was caused by human packaging error

    Anthropic said the Claude Code exposure was caused by a release packaging mistake due to human error rather than an external breach. The company also stated that no customer data or credentials were exposed.

    Claude Code Source Leaked via npm Packaging Error, Anthropic Confirms
  6. Apr 1, 20268mo ago

    Anthropic sends DMCA notices to remove leaked Claude Code copies

    Following the spread of the leaked repository, Anthropic sent DMCA takedown notices aimed at removing copies of the Claude Code source from GitHub and other locations. Reports indicate the legal effort struggled to contain already mirrored material.

    Claude Code codebase is leaked - Pivot to AI
  7. Mar 31, 20268mo ago

    Axios npm compromise may have affected Claude Code installs

    Some reports said a separate npm supply-chain compromise involving Axios versions 1.14.1 and 0.30.4 may have impacted Claude Code npm installs during a narrow window on 2026-03-31 UTC. This compounded concerns around the package distribution path during the leak.

    Claude Code Source Leaked via npm Packaging Error, Anthropic Confirms
  8. Mar 31, 20268mo ago

    Leaked Claude Code repository is mirrored and widely forked

    After the leak was identified, the exposed Claude Code source was archived, uploaded to GitHub, mirrored, and widely forked, making containment difficult. Multiple reports note that copies spread quickly before effective removal could occur.

    Anthropic accidentally exposes Claude Code source code • The Register
  9. Mar 31, 20268mo ago

    Researcher Chaofan Shou publicly discloses the Claude Code leak

    On 2026-03-31, security researcher Chaofan Shou publicly identified and disclosed that the Claude Code npm package leaked source through a .map file. The disclosure drew rapid attention to the exposed archive and its contents.

    Anthropic's Claude Code Source Code Reportedly Leaked Via Their npm Registry
  10. Mar 31, 20268mo ago

    Claude Code 2.1.88 published with source map exposing internal code

    On 2026-03-31, Anthropic's npm package version 2.1.88 for Claude Code was published with a large source map/debug artifact that exposed unobfuscated TypeScript source code from the product. Reports say the package enabled access to roughly 1,900 files and more than 512,000 lines of code hosted via Anthropic-controlled storage.

    Anthropic's Claude Code Source Code Reportedly Leaked Via Their npm Registry
Linked entities

Related entities

Vulnerabilities, threat actors, malware, products, organizations, and breaches Mallory has linked to this story.

Open in app →

Affected products

1 linked
Claude Code

Organizations

1 linked
Anthropic

Breaches

2 linked
ANTHROPIC-2026-03ANTHROPIC-2026-04
Do you run this?See attribution, scope, and whether this vendor sits anywhere in your supply chain.
Get the Full Incident Picture
Mallory platform

See the full picture, correlated to your attack surface.

This page covers what’s public. Mallory adds the parts that aren’t: which of your assets are affected, which threat actors are using it right now, and what to deploy next.

Exposure mappingMap indicators from this story to your assets and identify affected systems in minutes.
Threat actor evidenceEvery observed campaign, victim, and pivot linked to actors named in this story.
Associated malwareMalware, exploits, and IOCs connected to the activity described here.
Detection signaturesYARA, Sigma, and Snort rules deployed to your SIEM as soon as they’re published.
Scheduled alertsGet matching new stories delivered to your team as they break, not the next morning.
AI threadsAsk questions about this story and take action on the answers.