THURSDAY, MAY 21, 2026 · BRISBANESUBSCRIBE →

THE AI POST

INTELLIGENCE. CURATED.

Computer code on a dark screen representing the Claude Code source leak
BreakingMarch 31, 2026

Anthropic Shipped Its Entire Source Code to the Public by Accident. All 512,000 Lines.

A source map file left in an npm package exposed every line of Claude Code. The safety-first AI company just had its worst security day.

The AI Post

The AI Post newsroom — delivering AI news at the speed of intelligence.

The company that built its entire brand on being the responsible AI lab just accidentally published its most valuable intellectual property for anyone to download. On March 31, security researcher Chaofan Shou discovered that Anthropic shipped a source map file inside Claude Code's npm package that exposed the complete, unobfuscated source code of their flagship agentic coding tool. All 512,000 lines. All 1,900 TypeScript files. Everything.

Within hours, the code was archived on GitHub, where it racked up over 1,100 stars and 1,900 forks. The internet was reading Anthropic's homework.

What the Leak Reveals

This is not a trivial exposure. Claude Code is Anthropic's production-grade AI coding assistant, the tool that has been driving record subscriber growth and enterprise adoption. The leaked source reveals a sophisticated architecture: roughly 40 built-in tools, 50 slash commands, a multi-agent orchestration system they call "swarms," a bidirectional IDE bridge for VS Code and JetBrains, and a 46,000-line query engine that handles all LLM interactions.

The tool runs on Bun instead of Node, uses React with Ink for terminal UI rendering, and implements Zod v4 for schema validation across every input and output. It is, by any measure, a serious piece of software. And now every competitor on the planet can study it line by line.

The Irony Is Deafening

Anthropic positions itself as the safety-first alternative to OpenAI. It fought the Pentagon over responsible AI use. It ran Super Bowl ads mocking competitors for cutting corners. CEO Dario Amodei has made "responsible scaling" the company's identity.

And then someone forgot to exclude a source map from an npm publish command.

This is not the first time either. Earlier this month, Anthropic's unreleased Mythos model was accidentally exposed, raising what researchers called "unprecedented cybersecurity risks." Two major leaks in one month from the company that wants you to trust it with the future of AI.

What Happens Next

The immediate damage is reputational, not existential. Claude Code's value was never really in its source code being secret. It was in the underlying Claude models and the ecosystem around them. Open-source alternatives like Cursor and Aider already compete in this space.

But the pattern is what matters. Anthropic is growing at a staggering pace. Revenue more than doubled to $19 billion annualized. Paid subscribers are surging. And the operational discipline is clearly not keeping up with the growth. When you are shipping code to millions of developers and your build pipeline leaks the entire codebase, that is a process failure at the most basic level.

The HackerNews thread, which hit the top 5 within hours, is full of developers dissecting the architecture with genuine admiration for the engineering and genuine concern about the oversight. One comment captured it perfectly: "Not even a hack. They just shipped source maps in the npm package. Someone's having a bad day."

Anthropic has not yet issued a public statement on the leak. Given the company's track record with the Mythos incident, expect a carefully worded blog post within 24 hours and a quiet npm package update that strips the source maps.

The code is already everywhere. The question is whether Anthropic's "trust us, we're the safe ones" pitch can survive another month like this.

anthropicclaude-codesecuritynpmsource-leak