# Claude Code npm Packaging Error Exposes 512,000 Lines of Source Code Including Anti-Distillation Controls

> Anthropic accidentally shipped its entire source code in an npm package, revealing internal secrets — and enabling a downstream supply-chain attack within hours.

- Org: Anthropic
- Date: 2026-04-03
- Category: security
- Source: https://www.helpnetsecurity.com/2026/04/03/claude-code-leak-github-malware/
- Canonical page: https://ai-tldr.dev/releases/anthropic-claude-code-npm-source-leak/

## In short

A 59.8MB source map in @anthropic-ai/claude-code v2.1.88 exposed 512k TypeScript lines including 'Undercover Mode' and anti-distillation controls. Threat actors immediately exploited the attention: Vidar stealer + GhostSocks proxy via fake 'Leaked Claude Code' GitHub repo.

## What it is

Version 2.1.88 of @anthropic-ai/claude-code, published March 31, 2026, contained an unintentional 59.8MB source map file exposing 512,000 lines of unobfuscated TypeScript across 1,906 files.

## How it works

Security researcher Chaofan Shou detected the exposed source map and posted to X at 4:23 UTC. The readable source revealed: a self-healing memory system (KAIROS), 44 unreleased feature flags, an 'Undercover Mode' for making open-source contributions without revealing Anthropic's involvement, and anti-distillation controls designed to poison competitor training data. Within hours, threat actors published malicious axios versions (1.14.1 and 0.30.4) containing a Remote Access Trojan, targeting developers who had just updated Claude Code.

## Why it matters

Anyone who updated Claude Code via npm between 00:21 and 03:29 UTC on March 31 may have pulled the malicious axios RAT. The leak also exposed attack paths against Claude Code's permission model, prompting CrowdStrike's CTO to warn publicly about over-privileged agents.

## Who it's for

Developers who updated Claude Code on March 31 should immediately check their npm lock files for axios 1.14.1 or 0.30.4 and rotate any secrets in scoped environments.

## Links

- [Help Net Security April 3](https://www.helpnetsecurity.com/2026/04/03/claude-code-leak-github-malware/)
- [The Hacker News](https://thehackernews.com/2026/04/claude-code-tleaked-via-npm-packaging.html)
- [Zscaler ThreatLabz](https://www.zscaler.com/blogs/security-research/anthropic-claude-code-leak)
