← Google News

Claude Code Source Leaked via npm Packaging Error, Anthropic Confirms - The Hacker News

Google News · April 1, 2026
Claude Code Source Leaked via npm Packaging Error, Anthropic Confirms The Hacker News [truncated: Google News RSS provides only a snippet, not full article

Detailed Analysis

Anthropic accidentally exposed the full source code of its Claude Code AI coding assistant on March 31, 2026, when a source map file was inadvertently bundled into version 2.1.88 of the `@anthropic-ai/claude-code` npm package. Security researcher Chaofan Shou first identified the 60 MB `cli.js.map` file and publicized the discovery on X, where his post amassed over 28.8 million views within hours. The file, generated automatically by the Bun JavaScript runtime used in Claude Code's build pipeline, contained unobfuscated TypeScript source across approximately 1,900 files and 512,000 lines of code, hosted on Anthropic's R2 cloud storage. Anthropic confirmed the incident on April 1, 2026, characterizing it as a "release packaging issue caused by human error, not a security breach," and stated that no customer data or credentials were exposed. The package was swiftly unpublished, but the damage to containment was effectively immediate — the code spread to public GitHub repositories, accumulating over 84,000 stars and 82,000 forks before Anthropic began issuing DMCA takedowns.

The technical root cause traces to a straightforward but consequential omission in Anthropic's build process: the source map was never excluded through standard npm mechanisms such as `.npmignore`, the `files` field in `package.json`, or pre-publish dry-run verification via `npm pack --dry-run`. Source maps are a standard developer tool, generated by default in Bun and other modern runtimes to facilitate debugging by mapping compiled output back to original source code. While invaluable in development environments, their inclusion in production-distributed packages represents a significant operational security failure, especially for a proprietary AI system whose internal architecture is a core competitive and security asset. The oversight is particularly notable given that mitigation is straightforward and well-documented in the broader JavaScript ecosystem.

The security implications extend well beyond the immediate reputational harm. With access to Claude Code's internal architecture — including its four-stage context management pipeline — adversarial actors gain a meaningful advantage in probing for guardrail bypass techniques and crafting targeted prompt injection attacks. Almost immediately following the leak, a threat actor operating under the username "pacifier136" registered typosquatted versions of internal npm package names referenced in the leaked code, setting up dependency confusion attacks designed to compromise developers attempting to compile or extend the exposed source. This rapid exploitation underscores a well-understood but often underestimated supply chain risk vector: leaked internal package names become attack surfaces in the hands of bad actors, a concern amplified by the broader climate of npm ecosystem compromises such as the recent axios incident.

This incident is reportedly at least the third packaging-related exposure Anthropic has experienced, following similar incidents in 2025 and a separate leak of Claude Mythos internal documents. The pattern suggests systemic gaps in Anthropic's release engineering and secrets management practices that have persisted despite prior incidents. While the company pledged to implement preventive measures, the absence of specific commitments — such as mandatory pre-publish audits, automated source map exclusion policies, or enhanced CI/CD checks — leaves the security community without clear signals of remediation depth. For an organization whose core product is a closed-source AI system, repeated failures to protect proprietary build artifacts represent a credibility challenge that extends beyond technical inconvenience into questions of operational maturity.

The broader significance of the Claude Code leak sits at the intersection of AI competitiveness and software supply chain security. As AI coding assistants become deeply embedded in enterprise development workflows, the integrity of their distribution pipelines becomes a first-order security concern. Developers and organizations relying on tools like Claude Code are now advised to audit their own build environments, enforce source map exclusion in production configurations, and implement dependency verification practices. The incident reinforces a growing consensus among security practitioners that AI companies, despite their technical sophistication, remain subject to the same mundane operational security failures as any software organization — and that the consequences of those failures are amplified by the scale and sensitivity of the systems involved.

Read original article →