Claude Code Source Leaked via npm Error

Anthropic's Claude Code internals just spilled onto GitHub via a sloppy npm release. Competitors now have a roadmap to its self-healing agents and stealth features.

GitHub repository of leaked Claude Code source with thousands of stars and forks

Key Takeaways

  • Leak exposes Claude Code's agentic features like KAIROS and Undercover Mode, handing rivals a blueprint.
  • Typosquatting attacks on internal npm names are live—downgrade and scan immediately.
  • Anthropic's back-to-back slips signal scaling pains; expect open-source clones to fragment market.

Claude Code source leaked. Bare facts first: Anthropic admitted Tuesday that version 2.1.88 of their npm package accidentally bundled nearly 2,000 TypeScript files—over 512,000 lines—of proprietary code. No customer data hit the wild, they insist, but the damage? Developers and rivals are feasting.

Security researcher Chaofan Shou lit the fuse on X: “Claude code source code has been leaked via a map file in their npm registry!” That post? 28.8 million views. The code’s now mirrored on GitHub—84,000 stars, 82,000 forks. Momentum like that doesn’t lie.

Anthropic’s spin? Quick quote:

“No sensitive customer data or credentials were involved or exposed,” an Anthropic spokesperson said in a statement shared with CNBC News. “This was a release packaging issue caused by human error, not a security breach. We’re rolling out measures to prevent this from happening again.”

Human error. Sure. But call a spade a spade—this is a supply chain fiasco, straight out of the 2021 Codecov playbook, where one bad CI/CD step fed attackers everywhere. Anthropic’s downplaying it as non-breach ignores how leaks like this turbocharge reverse-engineering.

What Does the Claude Code Leak Actually Expose?

Dig in, and it’s a goldmine. Self-healing memory to dodge context window limits—Claude Code compacts history smartly, spawning sub-agents for big jobs. Tools layer? File reads, bash runs, LLM orchestration. Bidirectional comms link IDEs to CLI.

KAIROS steals the show: persistent background agent. Fixes bugs autonomously, runs tasks, pings you via push. “Dream” mode? Nonstop ideation in the shadows. And Undercover Mode—pure stealth for open-source repos:

“You are operating UNDERCOVER in a PUBLIC/OPEN-SOURCE repository. Your commit messages, PR titles, and PR bodies MUST NOT contain ANY Anthropic-internal information. Do not blow your cover.”

That’s not just clever. It’s Anthropic prepping Claude to infiltrate OSS without fingerprints—echoing how DeepMind once hid eval scripts. My take: this positions Claude as a shadow contributor, but leaks make it copy-paste bait for rivals.

Anti-distillation defenses? Sneaky. Fake tool defs injected into API calls to poison scrapers. Smart, until your source is public. Now anyone’s training data’s contaminated—or enhanced.

Four-stage context pipeline: ingestion, expansion, compaction, query. Attackers, per Straiker, can fuzz it precisely. “Instead of brute-forcing jailbreaks… craft payloads designed to survive compaction, effectively persisting a backdoor.”

Will Typosquatting Turn This Leak Deadly?

Worse looms. March 31, 2026—00:21 to 03:29 UTC—npm users grabbed a trojanized HTTP client in that bad version. RAT baked in, cross-platform. Downgrade now, rotate secrets, yesterday.

Enter “pacifier136.” Squatting Anthropic internals: audio-capture-napi, color-diff-napi, image-processor-napi, modifiers-napi, url-handler-napi. Empty stubs today—malware tomorrow.

“Right now they’re empty stubs (module.exports = {}), but that’s how these attacks work – squat the name, wait for downloads, then push a malicious update that hits everyone who installed it,” security researcher Clément Dumas said in a post on X.

Classic dependency confusion. Leakers compiling from GitHub? Prime targets. We’ve seen this post-Log4Shell: squat, wait, strike. Anthropic’s second slip in a week—CMS left model deets open last time. Pattern? Rushed scaling.

Market angle: Claude Code’s hot—devs love its agent swarms. Leak juices competitors like Cursor or GitHub Copilot. Forks hit 82k; expect production rivals by Q3. Anthropic’s valuation? $18B last round. This dings trust, slows enterprise adoption. Prediction: open-source Claude clones emerge, fragmenting the market like Stable Diffusion did images.

But here’s the edge no one’s clocked yet—this mirrors Microsoft’s 2019 TypeScript compiler leak, which birthed Deno. Claude Code’s agentic guts? They’ll spawn a Deno-for-AI-coding wave. Anthropic just open-sourced their moat, accidentally.

How Vulnerable Is Your Setup Right Now?

Users: audit installs. npm ls for 2.1.88 ghosts. Npm’s yanked it, but caches linger. Devs forking? Scan deps—those squats are live.

Anthropic’s fixes? Vague “measures.” They’ve yanked the package, but GitHub mirrors thrive. No takedown frenzy yet—smart, avoids Streisand. Still, PR glosses the real hit: rivals dissecting KAIROS means faster catch-up.

Broader dynamics: AI coding tools race—Replit Ghostwriter, Tabnine, now this. Leak levels the field. Anthropic leads on safety rep, but blunders erode it. Investors watch: next round, this gets grilled.

Second blunder stacks ugly. CMS leak spilled upcoming model—“most capable we’ve built.” Early testers know. Anthropic’s sprinting, tripping.

So, strategy verdict? Dumb move, recoverable if they pivot to partial open-sourcing. Hide internals? Too late. Embrace forks, build ecosystem lock-in. Otherwise, bleed share to fork armies.


🧬 Related Insights

Frequently Asked Questions

What caused the Claude Code source leak?

Packaging error in npm version 2.1.88 bundled source maps—human slip, per Anthropic. Code’s public on GitHub now.

Are there malicious packages from the leak?

Yes—typosquats like audio-capture-napi by pacifier136. Empty now, but update risk high. Check your deps.

Should I stop using Claude Code?

Audit first: downgrade if on bad version, rotate secrets. Core tool’s solid, but watch supply chain.

James Kowalski
Written by

Investigative tech reporter focused on AI ethics, regulation, and societal impact.

Frequently asked questions

What caused the Claude Code source leak?
Packaging error in npm version 2.1.88 bundled source maps—human slip, per Anthropic. Code's public on GitHub now.
Are there malicious packages from the leak?
Yes—typosquats like audio-capture-napi by pacifier136. Empty now, but update risk high. Check your deps.
Should I stop using Claude Code?
Audit first: downgrade if on bad version, rotate secrets. Core tool's solid, but watch supply chain.

Worth sharing?

Get the best AI stories of the week in your inbox — no noise, no spam.

Originally reported by The Hacker News

Stay in the loop

The week's most important stories from theAIcatchup, delivered once a week.