The Great Claude Code Leak

“A company that spent years protecting its code as a state secret leaked it through one npm publish at four in the morning

Anthropic just made Claude Code open source. By accident

Yes, I know what today’s date is. No, this is not a joke. Believe me, I checked it three times myself — because when you read “Anthropic leaked all the source code of Claude Code” on April first, the first reaction is completely logical: someone started celebrating early. Except it wasn’t someone. It was Anthropic. And they weren’t celebrating.

April 1, 2026. Anthropic — a company valued at $380 billion, which built its entire narrative around safety first and closed code — accidentally published the complete source code of Claude Code in an NPM package.

I found out in the morning, when I opened Claude Code for another routine workday. Within an hour, my X and Threads turned into a non-stop stream of screenshots, forks, and memes. Someone had already rechristened the company Anslopic — a play on AI slop that landed perfectly. 390,000 lines of TypeScript — everything Anthropic had hidden for years as its “secret sauce” — scattered across the internet faster than they could wake up in San Francisco.

How it happened: source maps in production

Version 2.1.88 of the Claude Code package on NPM contained a file that should never have left the dev environment — a 57-megabyte source map. For a non-technical audience: a source map is a file that links minified, unreadable code to the original source code. It’s used for debugging during development. In production, it’s not needed. And if it gets into production — congratulations, you just published all your source code.

The first to notice was Chaofan Shou — a security researcher from Solayer Labs. Within minutes, the code was being mirrored, forked, and analyzed all over the world.

How did the source map end up in the package? Claude Code is built on BunJS — a JavaScript runtime that Anthropic recently acquired. Bun has a known bug with server source maps in production, but Jared Sumner — the creator of Bun and now an Anthropic employee — confirmed that Claude Code doesn’t use bun serve, so this bug isn’t relevant here.

Theo from the t3.gg channel has his own theory: a few days before the leak, Anthropic was actively fighting rate limit issues in Claude Code. Several employees publicly wrote that they were investigating abnormally high usage numbers. It makes perfect sense that someone decided to enable more verbose logging — and accidentally packed source maps into the release build. One npm publish — and “secret sauce” became public domain.

Anthropic’s official response: “This was a packaging error caused by human error, not a security breach.” Theo sarcastically noted: interesting that a company building AI agents for writing code emphasizes human error.

DMCA hurricane and Theo in the crosshairs

Anthropic’s legal team responded the way all legal teams do — with DMCA takedowns. Hundreds of them. Possibly thousands. They started taking down repositories on GitHub, blocking mirrors, demanding file removal from Cloudflare R2.

But the code was already out there. Sending takedowns at that point is closing the barn door after the horse has bolted — but Anthropic’s lawyers apparently never got that memo.

Even people who simply forked the official Claude Code repository on GitHub got hit — the same repo that doesn’t contain the source code. Just forked a public repo — and received a DMCA. Theo called it “a world-record speedrun for the most bogus DMCA takedowns”.

Theo himself also got caught in the crossfire. His stream was titled — simply and eloquently: “I got DMCA’d by Anthropic…”. Anthropic’s lawyers, who should be busy with strategy, are instead fighting bloggers discussing publicly available information.

What Anthropic was hiding all this time

And now to the most interesting part. What was Anthropic hiding all this time?

Fireship from The Code Report described it aptly: Claude Code is essentially “dynamic prompt sandwich, glued together with TypeScript”. Not some magical alien technology, but basic programming concepts that have existed for 50 years, plus a bunch of prompt spaghetti.

Here’s what they found:

  • Hardcoded instructions — file after file of massive text strings that literally beg Claude to be a “good boy”. Tons of instructions and guardrails baked right into the code
  • Anti-distillation poison pills — a system to protect against being copied by competitors. Claude Code pretends to have tools that don’t actually exist. If someone trains their model on Claude outputs — it learns to work with fake tools and becomes worse. Clever, but now everyone knows there are only about 25 real tools
  • Undercover mode — a set of instructions that prohibit Claude from mentioning itself in commit messages. The goal: make the code look as “human” as possible. Officially, it’s to prevent model name leaks. Unofficially, it’s so Anthropic employees could quietly contribute to open source projects through Claude Code
  • Frustration detector — a regex frustration detector. Yes, a state-of-the-art AI model uses a simple regular expression that searches your prompt for keywords like “shit”, “fuck”, and so on. If it finds one, it logs an event to analytics. Simple. No magic involved
  • Bash tool — over 1000 lines of code for reliable bash command parsing and execution. Possibly the most important component of the entire product

Hidden features: from Tamagotchi to “God’s Time”

In addition to current functionality, the code contained a bunch of unreleased features under feature flags:

  • Buddy — a Tamagotchi companion that was supposed to “hatch” inside Claude Code between April 1-7. Presumably an April Fools’ joke from Anthropic. They probably won’t release it now
  • Dream Mode — background agents that automatically review your past sessions and consolidate memory while you sleep. The idea is for Claude Code to better adapt to your style without additional instructions
  • Coordinator Mode — one instance of Claude Code launches multiple workers in parallel, each with full tool access but specific tasks. Essentially — a manager distributing work to subordinates
  • Ultra Plan and Ultra Review — modes for long complex tasks via remote agents. Ultra Review — automatic code review with billing control. Anthropic previously announced code review at approximately $25 per PR — now it’s clear where that number came from
  • Kairos — a Greek word meaning “precise moment in time” or “God’s time”. It’s an always-on background agent that asks itself every few seconds: “Is there anything worth doing right now?” It can make changes, push notifications, edit files, create PRs and automatically update them when someone leaves feedback. Essentially, Claude Code that keeps working even when you’re not

Fireship also found references to Opus 4.7 and a new model codenamed Capybara — possibly the recently teased Mythos.

The irony: Anthropic couldn’t reveal Kairos at the “precise moment” it chose. Instead, the moment chose for them.

Code quality: 7 out of 10 — but the reviewer is somewhat biased

Theo asked Claude Code (yes, Claude Code itself) to rate the quality of the leaked code. The result: 7 out of 10. Possibly a somewhat biased assessment.

More specifically:

  • Type safety — solid. Only 38 instances of any across 500+ files
  • Async patterns — modern. 258 .then() chains, zero callback hell
  • Linting — they use Biome, 248 rule ignores
  • God files — files with 5000+ lines. That’s too much
  • Feature flags — over 1000 references to GrowthBook scattered across 250 files. Chaos
  • Environment variables — a mess. On Linux, Claude Code falls back to plain text for credential storage. Tokens are logged for debugging. And there’s no centralized sanitization of secrets before logging
  • No tests — but that’s likely due to the nature of source maps, which don’t include test files

390,000 lines of TypeScript. For comparison — OpenAI’s Codex, which was open source from the start, contains 515,000 lines of Rust code.

An interesting detail: in the Claude Code source, they found references to OpenCode — an open source competitor. Anthropic was copying OpenCode’s behavior for things like scrolling. So a closed company was peeking at open projects, not the other way around.

Forks, rewrites, and an army of clones

The open source community responded instantly. claude-code-fork appeared — a fork of the leaked code that immediately gained tens of thousands of stars on GitHub.

In parallel, openclaude appeared — a fork that works with any model. GPT, Gemini, local models — everything. Essentially, Claude Code without Anthropic.

Someone even tried to create a pull request to the official Claude Code repository with the leaked code. Anthropic, of course, deleted it. But the attempt was beautiful.

My take: when your main tool becomes the day’s biggest story

I use Claude Code daily. It’s my main work tool. I’ve built around ten projects with it — Kaplia Chat, Notes, EDU, client solutions. And recently I even went after sacred ground: I started writing a full-fledged multilingual plugin for WordPress — essentially a WPML replacement. But I’ll write about that separately. So for me this isn’t just another interesting story — it’s something deeply personal.

And you know what? I’m not surprised by what I saw in the code. The massive hardcoded prompts, the multi-layered instruction system, CLAUDE.md getting re-inserted on every turn — you could feel all of that while working with it. When you work with a tool 8-10 hours a day for months, you start to intuitively understand how it’s put together. The leak just confirmed that intuition.

What really surprised me was the regex-based frustration detector. Seriously, Anthropic? A company building one of the smartest AI models on the planet uses a simple regex to search for profanity in prompts? It’s like putting a wooden lock on a safe door.

On the irony of the situation

This story is pure irony from beginning to end.

Anthropic — a company that positioned itself as “safety first”. That spent years explaining why closed code is better for humanity. That used the “secret sauce” argument as the reason not to open-source Claude Code. That sent DMCA notices even for previous minor leaks.

This same company leaked everything through one NPM package at four in the morning.

Fireship summed it up best: Anthropic officially became more open source than OpenAI. And this is not a joke — it’s a fact.

Theo added another layer of irony: Claude Code ranks 39th on TerminalBench among coding harnesses. Filter by the Opus model alone, and Claude Code still ranks last among Opus harnesses. Cursor scores 93% with the same Opus, while Claude Code sits at 77%. The same “secret sauce” that Anthropic so jealously guarded turned out to be not that secret — and not that much of a sauce.

What Anthropic should do: advice from the community

In his video, Theo gave Anthropic a clear, multi-point piece of advice, and I agree with every word:

Open the code. Not necessarily tomorrow. But provide a roadmap and timeline. A month or two to clean up the codebase, remove commit history, prepare the repository — that’s perfectly reasonable. Just say: “We plan to do this. Here’s when.”

Stop sending DMCA notices. The code is already everywhere. You can’t hide it now. Every new takedown is not intellectual property protection — it’s a PR disaster. Especially when you send them to people who aren’t even using the leaked code.

Let engineers speak. You have people who spent years building features they couldn’t talk about. Dream Mode, Coordinator Mode, Kairos — behind each of these names is an engineer proud of their work. Instead of corporate press releases — let those people step up and talk about what they built and why.

Be human. Theo gave an example from OpenAI: when he criticized their frontend models, instead of lawyers, an engineer answered him — with humor and self-deprecation. One human tweet did more for OpenAI’s reputation than ten press releases. Anthropic, which positions itself as a “human” company, so far communicates with the community exclusively through lawyers.

It is what it is

This situation is not the end of the world for Anthropic. Claude remains a powerful model. I’m not going to migrate to another tool because of this leak. Although lately I’ve been more annoyed by endless “Elevated timeouts on requests to Claude Opus 4.6” on the status page — especially when you’re paying for a Max plan. Coincidence with the leak? I don’t think so. But it’s a moment of truth: how a company responds to a crisis says more about it than any marketing ever could.

So far, Anthropic has chosen the path of lawyers and DMCA takedowns. But the door is already open. And, as Theo aptly noted, true community enthusiasm will always defeat corporate panic.

390,000 lines of TypeScript now belong to the internet. Anthropic can either make this an advantage — or spend the next few months sending takedown notices into the void.

For now, I’m heading back to work in Codex Claude Code.

Vitalii Kaplia

Founder, Web Developer & WordPress Expert

I became interested in programming back in 1997. The first acquaintance with a future profession was using Visual Basic. In…

More about author

A digital product engineer and web solutions architect

Free consultation + cost calculation

More interesting articles

Customer login

This site uses cookies

We use cookies to personalize content and ads, provide social media features, and analyze our traffic. We also share information about your use of our website with our social media, advertising, and analytics partners, who may combine it with other information you have provided to them or collected when you use their services. By continuing to use our site, you consent to our use of cookies and accept our Privacy Policy and Terms of Use.

Virtual assistant
Hi! I'm the KAPLIA.PRO virtual assistant! I can tell you about our services, portfolio projects, ballpark pricing, and how we work — from websites and eCommerce to web apps, CRMs, bots, and AI agents. Ask away!

By continuing with the AI assistant, I agree to the site’s terms of use and privacy policy.

AI assistant may make mistakes in responses