# Claude Code Source Leak: What 513,000 Lines of TypeScript Reveal

> Anthropic accidentally published the complete source code of Claude Code – and attackers seized the moment. A look at the vulnerability and what it means.

- URL: https://www.deepblue-ai.cloud/en/claude-code-source-leak/
- Author: Dr. Markus Weber
- Published: 2026-04-04
- Section: AI News Radar
- Tags: Security, Claude Code, Source code leak, Anthropic
- 2 min read
- Also available: [de](https://www.deepblue-ai.cloud/de/claude-code-source-leak/index.html.md)

On 31 March 2026, Anthropic accidentally published a JavaScript source map for **Claude Code v2.1.88** on npm. What sounds like a minor slip turned out to be a massive data leak: 513,000 lines of unobfuscated TypeScript, 1,906 files – the complete source code of one of the most influential AI coding tools in the world was suddenly out in the open.

## What was leaked

The leak revealed far more than expected: the agent's complete orchestration logic, the permission system, hidden features that had not yet been made public, build details and – particularly sensitive – security-relevant internals. For security researchers it was a gift. Unfortunately, for attackers too.

## The vulnerability: CVE-2026-21852

Using the source code, security researchers at Adversa discovered a critical vulnerability: when Claude Code is confronted with a command made up of more than 50 subcommands, it disables its compute-intensive security analysis from the 51st subcommand onwards – and simply asks the user whether they want to continue instead.

The practical consequence: an attacker can distribute a legitimate-looking code repository containing a poisoned `CLAUDE.md` file. As soon as Claude Code reads it in and has built up enough context, SSH keys, AWS credentials, GitHub tokens and other secrets can be exfiltrated – without the security analysis stepping in.

The particularly awkward part: Anthropic had already implemented the fix – a tree-sitter parser – in the source code. It just wasn't enabled in the public builds.

> **My take**
>
> This incident highlights a fundamental tension in AI development: speed vs. security. Claude Code is a powerful tool that is deeply integrated into development environments – it reads code, writes code, executes commands. That makes it an attractive target.
>
> What concerns me most: the vulnerability was known and a fix already existed – it simply hadn't been deployed. That's not a technical failure but a process failure. For a tool that can have access to production credentials, that's hard to justify.
>
> On the other hand: Anthropic responded and communicated quickly. And the leak has an upside too – it shows the community how agents like this are built internally, and in the long run it will lead to better design.

## What the attackers made of it

Threat actors seized the moment immediately: fake GitHub repositories named "Claude Code" popped up and delivered the **Vidar infostealer** when cloned. Developers who were hastily searching for the leaked code became targets.

**Recommendation:** Only install Claude Code via the official Anthropic documentation. Don't clone unofficial repositories. And: source maps in npm packages should always be excluded from production releases – a simple build-process check that prevents leaks like this.

Sources: [Fortune](https://fortune.com/2026/03/31/anthropic-source-code-claude-code-data-leak-second-security-lapse-days-after-accidentally-revealing-mythos/) · [BleepingComputer](https://www.bleepingcomputer.com/news/security/claude-code-leak-used-to-push-infostealer-malware-on-github/) · [Check Point Research](https://research.checkpoint.com/2026/rce-and-api-token-exfiltration-through-claude-code-project-files-cve-2025-59536/)
