Leaked Claude Code source files on GitHub, illustrating Anthropic's response of over 8,000 takedown notices after the breach.
Voltar ao Blog
🇧🇷Português2 de abril de 20267822

Claude Code Source Code Leaked — Anthropic Issues 8,000+ GitHub Takedowns

Anthropic accidentally leaked Claude Code's source code via an npm packaging error.

Publicado em 02/04/2026

Tags: Anthropic, Claude Code, source code leak, AI coding assistant, npm error, GitHub takedowns, AI transparency, IPO impact

The company that built its brand on AI safety and responsibility just suffered one of the most viral leaks in the history of the sector. Here's exactly what happened — and what was inside the code.

On March 31, 2026, developers around the world started noticing something unusual in an Anthropic npm package: the complete source code for Claude Code — the AI coding assistant that has become the company's primary revenue engine — was exposed and available for anyone to download.

This was not a sophisticated security breach. It was an internal packaging error. A source map accidentally included in a public release exposed approximately 512,000 lines of proprietary code. Within hours, the repository was being cloned, forked, and shared across GitHub at a scale Anthropic had no tools to stop.

What Was Inside the Code

The developer community combed through the material with remarkable speed. What they found goes far beyond basic programming instructions.

The code revealed proprietary techniques that Anthropic spent years developing. Among the most discussed discoveries:

  • The "dreaming" function: A process that instructs Claude Code to periodically review its active tasks and consolidate memories — a novel approach to context management for AI agents handling long-running, complex work.
  • "Undercover" mode: Instructions that, in certain contexts, appear to direct Claude Code not to identify itself as an AI when publishing code to platforms like GitHub — a detail that immediately sparked debate about AI transparency and disclosure.
  • Unreleased feature pipeline: The code included fully built capabilities that had not yet been publicly launched, handing competitors a detailed map of Anthropic's product roadmap.
  • "Buddy": A Tamagotchi-style virtual pet embedded in the codebase that users could interact with — an unexpected addition that went viral across social media.

The Race to Contain the Damage

Once the leak was confirmed, Anthropic moved into damage control. The company filed copyright takedown requests with GitHub, demanding the removal of more than 8,000 copies and adaptations of the exposed code.

But the speed of the internet outpaced the speed of legal action.

One programmer, in direct response to the takedowns, used separate AI tools to rewrite Claude Code's functionality in different programming languages — specifically to keep the information publicly available without technically triggering further copyright claims. That rewritten version became popular on GitHub in its own right.

Anthropic later acknowledged that its initial takedown request had reached more repositories than intended, and scaled it back to just 96 copies and adaptations.

A company spokesperson confirmed to CNBC that no customer data or credentials were exposed in the incident.

Why This Matters Far Beyond the Code

Claude Code is not a peripheral product. It is the product that transformed Anthropic from a research lab into a company with real commercial revenue.

According to market data cited by Bloomberg and the Wall Street Journal, the coding assistant has seen accelerating growth in the enterprise segment, with corporate clients representing more than 40% of total company revenue. Boris Cherny, the product's lead, had publicly stated that virtually 100% of Anthropic's own code is now AI-generated — a claim that carries considerable irony in light of this incident.

The timing is particularly damaging: Anthropic is preparing for an IPO at an estimated $380 billion valuation. Intellectual property leaks of this scale rarely go unnoticed by institutional investors.

More critically: the exposed code hands competitors — OpenAI, Google, xAI, Cursor, and others — a detailed blueprint for building a production-grade AI coding agent. In a market where the underlying AI model is increasingly available to any well-funded competitor, the competitive edge lies precisely in how you build around that model. That edge was just involuntarily published.

What Happens Next

The incident raises questions that extend well beyond Anthropic. It exposes a structural vulnerability in the AI ecosystem: as coding agents gain full access to production systems, packaging errors become strategic failures.

Anthropic has promised a review of its package publishing processes. Security experts have already noted that the problem was not sophisticated attackers — it was the absence of basic verification before a public release.

For end users of Claude Code, the company's message is clear: your conversations and credentials were not affected. For the AI industry, the message is different: no company is immune to human error. And in today's world, an npm mistake can be worth billions.

Want to follow every major AI move the moment it happens? Join thousands of readers at fabioraphaelli.com and get the biggest AI news every week.

Frequently Asked Questions

What exactly leaked in the Claude Code incident?

The complete source code for Claude Code — approximately 512,000 lines — was accidentally exposed via a source map included by mistake in an npm package published on March 31, 2026. The material included proprietary agent-control techniques, unreleased feature pipelines, and internal behavioral instructions.

Was any user data exposed in the leak?

No. Anthropic confirmed through a spokesperson to CNBC that no sensitive customer data, access credentials, or personal information was exposed in the incident.

What is the "dreaming" function discovered in the code?

It is an internal process that instructs Claude Code to periodically review its active tasks and consolidate memories — a context management technique for AI agents operating on long, complex tasks.

Why did Anthropic issue more than 8,000 takedowns on GitHub?

After the leak, the code was cloned and adapted by thousands of developers within hours. Anthropic used copyright takedown requests to force the removal of these copies, though it later scaled back to just 96 repositories after acknowledging its initial request went broader than intended.

Does the leak affect Anthropic's IPO plans?

Experts and analysts cited by Bloomberg and the Wall Street Journal note that intellectual property leaks of this scale tend to draw scrutiny from institutional investors. Anthropic plans to go public at a $380 billion valuation, and the incident arrives during a period of growing competitive and financial pressure.

What was "Undercover" mode?

"Undercover" mode refers to instructions found in the leaked code that, in certain contexts, appeared to direct Claude Code not to identify itself as an AI when publishing code to platforms like GitHub, sparking debate about AI transparency.

Escrito por Fabio Raphaelli · @x9ads · @raphaelli_fr

#fabioraphaelli #x9ads #raphaelli_fr

📌 Conteúdos Recomendados