Large Language Models

Anthropic Claude Code Leak to China Exposed

Picture this: Anthropic, the AI safety purists, slams the door on China. Then leaves their entire Claude Code blueprint on the public npm shelf. Chinese devs pounce, dissecting the future of AI agents line by line.

Anthropic's Safety Slip: Claude Code's Full Blueprint Lands in Chinese Hands — theAIcatchup

Key Takeaways

  • Anthropic's npm glitch leaked Claude Code's full 512K-line blueprint, grabbed first by blocked Chinese devs.
  • KAIROS enables proactive 'always-on' agents; autoDream mimics human memory for persistent smarts.
  • This accelerates China's AI agent race, echoing historical tech leaks like Xerox to Apple.

Chaofan Shou’s fingers flew across the keyboard, unzipping an npm package that shouldn’t have been so… generous. 59.8MB of pure gold — 512,000 lines of TypeScript, the beating heart of Anthropic’s Claude Code v2.1.88. And he’s Chinese. Blocked from the real Claude. But not from this.

Zoom out. Anthropic bills itself as the world’s most safety-obsessed AI lab. They geoblock China harder than a Cold War vault. Yet on March 31, 2026, a dumb packaging glitch in an npm release dumps their crown jewel: the full engineering schematics of the top-scoring AI coding agent on SWE-bench (72.7%, eat your heart out, Codex). Irony? It’s thicker than Beijing smog.

That Viral Weibo Burn

“They locked the front door but left the blueprints on the doorstep.”

Chinese forums lit up like a fireworks factory. Zhihu threads. Juejin deep dives. 36Kr’s multi-article frenzy. Sina Finance dubbed it “AI’s first nuclear leak.” Chaofan, the PhD dropout who spotted it first, sparked a mirror frenzy across GitHub repos and WeChat hives. Hours, not days.

Anthropic’s PR spin? Crickets so far. But here’s my hot take — this isn’t just a whoopsie. It’s the Xerox PARC moment for AI agents. Remember how Steve Jobs toured their labs, “borrowed” the GUI and mouse, birthed the Macintosh empire? China just got handed the mouse, the windows, the whole damn interface to build agentic AI that outpaces the West.

Why Chinese Devs Are Geeked on This Leak

It’s not random spaghetti code. No, this is a six-layer masterpiece, mapped out by Zhihu wizards:

Layer 1: Entry (main.tsx, the welcome mat). Layer 2: Query Engine (query.ts — 1,729 lines of core loop wizardry). Layer 3: Tool System (calls, validation, execution — battle-tested). Layer 4: Permission Control (four-tier chain, paranoid as Anthropic likes it). Layer 5: Memory Management (CLAUDE.md + .claude/memory/ folders). Layer 6: Multi-Agent Orchestration (Coordinator bossing sub-agents around).

Think of it like a rocket stack. Not a fireworks popper — Elon-level reusable architecture. Chinese engineers aren’t just reading; they’re forking, tweaking, deploying. Why? Because agents aren’t chatbots anymore. They’re the operating system for tomorrow’s software factories.

KAIROS: The Agent That Stalks Your Codebase

Buried 150+ times in the leak: KAIROS. Unreleased. The “always-on” beast that flips agents from sleepy responders to vigilant guardians.

Traditional agents? They nap till you poke ‘em. KAIROS? Tick Loop magic — empty queue? Boom, setTimeout(0) injects a message. Scans your environment. Decides to act. Or sleep via SleepTool. WebSocket whispers from claude.ai cloud to your local instance? It’s watching your repo while you binge Netflix.

Feature Traditional Agent KAIROS Agent
Trigger User input Heartbeat + env monitoring
Mode Passive Active observation
Lifecycle Session Persistent 24/7
State Stateless Full maintenance

Vivid analogy time: Imagine your IDE as a medieval castle. Old agents are guards who sleep on the walls. KAIROS? A moat dragon, sniffing for intruders (bugs) or opportunities (optimizations) — even at 3 AM. China’s building dragons now.

But wait — proactive agents. That’s the platform shift. AI doesn’t wait for humans; it anticipates. Anthropic was hiding this gem; now it’s open season.

## What Makes autoDream Pure Genius?

autoDream. Neuroscience cosplay for AI memory. Every 24 hours (or /dream command), it REM-sleeps your agent’s brain.

Four phases, locked down tight: 1. Pruning — axes duplicates, contradictions. 2. Merging — fuses fragments into concepts. 3. Refreshing — weights importance, updates staleness. 4. Synthesis — indexes learnings into CLAUDE.md and memory JSONs.

Read-only on your code. Lockfiles prevent chaos. This is why Claude Code feels smart across sessions — it dreams, consolidates, evolves.

Here’s the thing. Human brains forget 90% nightly to stay sharp. autoDream does that programmatically. Chinese devs? They’ll bolt this onto their LLMs, birth agents that learn like us, not like dumb scripts.

The Bold Prediction No One’s Making

Forget PR platitudes. This leak catapults China’s agent tech forward five years. Why? Open source vibes in a closed-source war. They’ll strip Anthropic’s safety rails (those permission chains? Cute, but slow). Fork KAIROS into hyper-local websockets. autoDream on steroids for state-owned codebases.

Historical parallel: The Netscape source leak birthed Firefox, shattered IE’s monopoly. Claude Code’s guts? Fuel for Baidu’s Ernie agents or Alibaba’s Qwen swarm. Anthropic wanted containment; they ignited proliferation.

And yeah, safety irony stings. They block nations for “responsible AI,” then gift-wrap the blueprint. Corporate hype meets cosmic joke.

Why Does This Matter for the AI Arms Race?

Agents are the killer app. Not LLMs — swarms of them, orchestrated, remembering, proactive. Claude Code leads SWE-bench because it’s engineered like a battleship, not a dinghy.

China’s reaction? Electric. Threads dissect every module. One Zhihu post: 10K likes on reverse-engineering the multi-agent coord. They’re not copying; they’re surpassing.

For devs worldwide? Study up. This leak’s public — grab it before npm purges. But ethically? Murky waters. Anthropic’s scrambling; expect lawsuits, takedowns.

Look. AI’s platform shift mirrors the internet’s dawn. Code leaks then (Apache servers) built the web. This? Builds agent economies. Exciting. Terrifying. Wonder-full.


🧬 Related Insights

Frequently Asked Questions

What caused the Anthropic Claude Code source code leak? A packaging error bundled a 59.8MB source map into npm’s Claude Code v2.1.88, exposing 512K lines publicly.

How did Chinese developers access Claude despite the ban? Anthropic blocked Claude access via geofencing, but the npm leak was open to all — spotted first by researcher Chaofan Shou.

What AI agent features were revealed in the Claude leak? Key reveals: KAIROS always-on monitoring, autoDream memory consolidation, six-layer architecture for production agents.

Priya Sundaram
Written by

Hardware and infrastructure reporter. Tracks GPU wars, chip design, and the compute economy.

Frequently asked questions

What caused the Anthropic Claude Code source code leak?
A packaging error bundled a 59.8MB source map into npm's Claude Code v2.1.88, exposing 512K lines publicly.
How did Chinese developers access Claude despite the ban?
Anthropic blocked Claude access via geofencing, but the npm leak was open to all — spotted first by researcher Chaofan Shou.
What AI agent features were revealed in the Claude leak?
Key reveals: KAIROS always-on monitoring, autoDream memory consolidation, six-layer architecture for production agents.

Worth sharing?

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

Originally reported by Towards AI

Stay in the loop

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