Skip to content
IFAI

Industry

Anthropic accidentally leaks Claude Code source code

Published Reach 46

Anthropic just inadvertently exposed the source code for Claude Code after publishing debug map files directly to the npm registry. Security researcher Chaofan Shou spotted the oversight and extracted the package contents. Why it matters: It is an embarrassing operational slip-up showing that even frontier AI labs can fumble basic production hygiene.

Anthropic accidentally leaks Claude Code source code
Image: community.openai.com

It’s every developer’s worst nightmare: shipping a build to production, only to realize you accidentally packaged the entire raw source code with it.

Except this time, it wasn't a sleep-deprived indie dev. It was Anthropic.

A packaging oversight recently exposed the proprietary source code of Claude Code, Anthropic’s flagship terminal-based coding tool, through npm. Then, in an effort to contain the leak, Anthropic went on a copyright takedown spree that accidentally nuked thousands of legitimate GitHub repositories.

An npm leak and a prompt-hunting spree

The leak started with a classic oversight. Researcher Chaofan Shou discovered that a recent npm release of Claude Code contained source map files.

Source maps exist to help engineers debug minified code during development. But if you accidentally push them to a public registry, anyone can reconstruct your original TypeScript and prompt engineering.

Naturally, the AI community jumped on it immediately. Enthusiasts dug through the exposed code on GitHub, hunting for clues on how Anthropic structures Claude’s internal prompts, coordinates agentic tool use, and manages local context.

Copies of the code spread across GitHub within hours.

8,100 repos caught in the crossfire

Anthropic quickly called in the lawyers. The company issued a DMCA takedown notice asking GitHub to pull the offending repositories off the internet.

GitHub followed through, but the automated banhammer struck way too wide. According to GitHub records, the notice swept up around 8,100 repositories — including countless developers who had simply forked Anthropic’s public Claude Code repository for everyday open-source use.

Following widespread developer outrage, Claude Code lead Boris Cherny stepped in to clarify that the mass takedown was an accident. Anthropic explained to TechCrunch that the targeted repo sat within the fork network of its public repository, causing GitHub’s automation to sweep up every branch connected to it.

Anthropic quickly retracted the bulk of the claim, narrowing the block to just one repo and 96 forks that actually held the leaked source. Access for everyone else was restored.

Why it matters

For everyday developers, this is an amusing reminder that even frontier AI labs struggle with basic CI/CD pipeline sanitation. If you build CLI tools or package node modules, make sure your `.npmignore` and bundle configs are actually dropping debug artifacts.

For the AI ecosystem, the leaked source code pulled back the curtain on how one of the best coding agents in the world operates under the hood. Developers now have a much clearer view into Anthropic’s orchestration patterns and prompt design, which could accelerate open-source alternatives targeting Claude Code's market share.

For Anthropic, however, this clean-up was undeniably messy. With the company reportedly eyeing an IPO, leaking your marquee product’s source code and subsequently carpet-bombing 8,000 developer repos isn't great for public trust. We think Anthropic handled the retraction transparently, but the episode shows that rapid product scaling is putting serious strain on their operational hygiene.

Sources (2)

  1. [1]
    x.com(opens in a new tab)Originalx.com
  2. [2]
    techcrunch.com(opens in a new tab)Reporttechcrunch.com

Best of AI, daily