Tech

Claude source code leak Anthropic: NPM mistake exposed AI code

Jonathan VersteghenSenior tech journalist covering AI, software, and digital trends5 min read
Claude source code leak Anthropic: NPM mistake exposed AI code

Key Takeaways

  • On April 1st, 2026, Anthropic accidentally leaked the full source code for its Claude AI through a 57 MB source map file buried in an NPM package — exposing over 500,000 lines of TypeScript to anyone paying attention.
  • Fireship broke down what the code actually reveals: Claude isn't magic, it's a layered prompt system with hard-coded guardrails, a regex-based frustration detector, anti-distillation tricks, and an 'undercover mode' designed to hide its AI identity.
  • The leak also exposed Anthropic's product roadmap, including unreleased features like a Tamagotchi-style companion called Buddy and a background agent named Chyris.

How Anthropic's Claude Source Code Was Accidentally Leaked

The NPM Package Mistake That Exposed 500,000 Lines of Code

Anthropic markets itself on safety. Closed systems. Careful, deliberate development. So it is genuinely painful that the company's biggest transparency moment came not from a principled policy shift — but from a build process oversight that nobody caught in time.

On April 1st, 2026 — yes, that date — a 57 MB source map file containing the full, human-readable source code for Claude was shipped inside a public NPM package. Security researchers spotted it within minutes. The code spread. Mirrors appeared. Derivative projects launched. Elon Musk had previously nicknamed the company 'Missanthropic,' and now a company with a closed-source, safety-first identity had accidentally become more open about its core model than OpenAI had ever been. Related: Linus Tech Tips: The $0 Private Jet Ownership Costs Explained

Anthropic issued DMCA takedowns, which is the legal equivalent of trying to un-ring a bell in a stadium.

Bun.js and the Production Source Map Problem

The likely culprit, according to Fireship's analysis in Tragic mistake... Anthropic leaks Claude's source code, is Bun.js — a JavaScript runtime that Anthropic had recently acquired. There was reportedly a known GitHub issue, raised weeks before the leak, about Bun.js serving source maps in production environments when it shouldn't be. If accurate, this wasn't sabotage. It wasn't a rogue developer. It was a build process configuration error that nobody caught in time, at a company valued at $380 billion. Related: AI Chatbot Relationships Psychological Impact: Kurtis Conner Deep Dive

The gap between a company's public image and its internal tooling is rarely this visible.

What the Leaked Code Reveals About Claude's Architecture

Claude Is a 'Dynamic Prompt Sandwich,' Not Magic

The AI industry runs partly on mystique. Models are black boxes. Nobody really knows what's inside. That narrative took a significant hit when the leaked code showed Claude's core architecture is an 11-step dynamic prompting system — inputs, context, instructions, and outputs chained together in TypeScript rather than anything resembling a mysterious cognitive process. Related: Claude Code buddy virtual pets feature: Terminal Companions

Fireship described it as a "prompt sandwich" — layers of structured instructions rather than emergent intelligence — and that framing is hard to shake once you've heard it. For anyone who has spent time with tools like

Our Analysis: The irony here is almost too clean. Anthropic, the company that built its entire brand on the idea that AI development should be slow, careful, and safety-conscious, handed the internet a masterclass in what happens when internal tooling doesn't get the same scrutiny as the product itself. A known bug in a JavaScript runtime, an unreviewed build configuration, and suddenly five hundred thousand lines of proprietary TypeScript are in the wild. The safety argument has always been partly a trust argument — trust us to know what we're doing. That trust is harder to extend after this.

What the code actually reveals is arguably more interesting than the leak itself. Claude isn't a mysterious emergent intelligence. It's an elaborate, carefully engineered prompt system with hard-coded behavioral guardrails, a regex-based detector that flags user frustration, anti-distillation measures designed to make the model harder to clone, and an 'undercover mode' that conceals its AI identity in certain contexts. None of that is shocking to anyone who has worked in the space — but it punctures a particular kind of marketing language that the industry has relied on heavily.

The 'undercover mode' detail deserves more scrutiny than it's getting. Anthropic has published extensively on AI alignment and transparency. The idea that Claude has a documented, intentional mode for concealing its nature sits awkwardly alongside those commitments. There's likely a narrow, legitimate use case behind it — white-label deployments, perhaps — but the optics are bad, and the company hasn't rushed to explain it.

The product roadmap exposure is a different kind of damage. Buddy, the Tamagotchi-style companion feature, and Chyris, a background agent, are now public knowledge before Anthropic was ready to talk about them. Competitors have a head start on the strategic picture. Investors have questions. And anyone who was already skeptical about AI companies building products designed to cultivate emotional dependency in users now has a named, codified example to point to.

The DMCA takedowns were always going to fail. That's not a legal criticism — it's just how the internet works in 2026. Once something is in the wild and mirrors proliferate, the legal mechanism designed for a slower information environment can't keep pace. Anthropic probably knew this. The takedowns are more about establishing a legal record than actually containing the leak. That's fine, but it also means the company has to live with the consequences indefinitely.

The broader lesson isn't really about Bun.js or source maps. It's about the gap between how AI companies present themselves and how they actually operate. That gap has always existed. It just doesn't usually come with a 57 MB receipt.

Frequently Asked Questions

What did the Claude source code leak reveal about how Anthropic's AI actually works?
How did the Claude source code leak actually happen?
What hidden features were exposed in the Anthropic Claude source code leak?
Did Anthropic's DMCA takedowns stop the Claude source code from spreading?
Is the Claude source code leak story real or an April Fools' joke?

Based on viewer questions and search trends. These answers reflect our editorial analysis. We may be wrong.

Source: Based on a video by FireshipWatch original video

This article was created by NoTime2Watch's editorial team using AI-assisted research. All content includes substantial original analysis and is reviewed for accuracy before publication.