xiji2646-netizen

xiji2646-netizen

Claude Code's entire source just leaked (512K lines) - anyone else digging through it?

Woke up to this today: Claude Code’s complete source code exposed via npm source map. Not a snippet. All 512,000 lines. 1,900 TypeScript files.

How it happened

Single .map file in production npm package → R2 bucket URL → complete source download.

Classic supply chain security fail.

What’s exposed

  • QueryEngine.ts (46K lines): entire LLM API engine
  • Tool.ts (29K lines): all agent tools
  • commands.ts (25K lines): slash commands
  • ~40 tools, ~85 commands
  • Feature flags: PROACTIVE, VOICE_MODE, BRIDGE_MODE, KAIROS
  • Easter egg: BUDDY digital pet system (hidden, April launch planned)

Anthropic’s response

Removed source map, deleted old npm versions. Too late — 3+ GitHub mirrors already exist.

The ironic part

This is Anthropic’s second leak in 5 days. March 26: CMS error exposed unreleased “Claude Mythos” model + 3K assets.

Community: “The irony is unreal” — Anthropic markets Claude’s code review capabilities, then leaks own code via config error.

Nuanced take

Developer Skanda: “This ‘leak’ is clickbait. Claude Code CLI has always been readable in npm package (minified JS). Source map just makes it readable TypeScript.”

He’s right. Anthropic never treated CLI logic as secret. Core moat = Claude model, not CLI tool.

But: seeing code ≠ understanding code. Source map lowered barrier significantly.

What you can learn

Developer Jingle Bell analyzed the codebase, found 4 production patterns:

  1. System prompt engineering: Tool constraints, risk controls, output specs make AI predictable
  2. Multi-agent orchestration: Coordinator mode, permission mailbox, atomic claims, team memory
  3. Three-layer context compression: MicroCompact (local), AutoCompact (near limit), Full Compact (nuclear option)
  4. AutoDream memory consolidation: Background process, 4-phase flow (Orient → Gather → Consolidate → Prune)

For developers, this is a free masterclass in production AI architecture.

Discussion questions

  • Is this actually a “leak” if the minified code was already public?
  • Does exposing CLI architecture hurt Anthropic’s competitive position?
  • What’s the biggest lesson here — supply chain security or AI architecture patterns?

Links:

Anyone else spending their weekend reading through this?

First Post!

dyowee

dyowee

reading source code != understanding source code

:slight_smile:

Where Next?

Popular Ai topics Top

AstonJ
I saw this clip of Elon Musk talking about AI and wondered what others think - are you looking forward to AI? Or do you find it concerning?
New
AstonJ
Watching any? Any favourites? :upside_down_face:
New
AstonJ
Can you spot the AI generated person in the pic below? ▶ Spoiler Video here:
New
Eiji
Today, I tried to find some information and few times I not only got completely wrong answers, but even fake GitHub links … Every time I ...
#ai
New
apoorv-2204
I’m reaching out to all software engineers, especially senior developers — I really want to hear your thoughts. I’ve always loved buildi...
New
apoorv-2204
General thoughts on google gemini ? IMHO , when compared chatgpt and claude sonnnet its pretty shit, and its feels broken,
#ai
New
nix0097
Hello I hope you’re doing well. I’m looking to develop a custom chatbot and would love to collaborate with you on this project. The chat...
New
xiji2646-netizen
I’ve been tracking this for the past two weeks and wanted to see if others are experiencing the same thing. BridgeBench (independent hal...
New
xiji2646-netizen
Just went through the Anthropic migration guide for Opus 4.7 and there are more gotchas than the announcement implied. Curious if others ...
New
xiji2646-netizen
Anthropic launched Claude Design this week and there’s a lot of noise about the generation demos and the stock reaction. But the feature ...
New

Other popular topics Top

PragmaticBookshelf
Free and open source software is the default choice for the technologies that run our world, and it’s built and maintained by people like...
New
PragmaticBookshelf
Learn from the award-winning programming series that inspired the Elixir language, and go on a step-by-step journey through the most impo...
New
PragmaticBookshelf
Ruby, Io, Prolog, Scala, Erlang, Clojure, Haskell. With Seven Languages in Seven Weeks, by Bruce A. Tate, you’ll go beyond the syntax—and...
New
DevotionGeo
I know that these benchmarks might not be the exact picture of real-world scenario, but still I expect a Rust web framework performing a ...
New
PragmaticBookshelf
From finance to artificial intelligence, genetic algorithms are a powerful tool with a wide array of applications. But you don't need an ...
New
AstonJ
There’s a whole world of custom keycaps out there that I didn’t know existed! Check out all of our Keycaps threads here: https://forum....
New
AstonJ
Saw this on TikTok of all places! :lol: Anyone heard of them before? Lite:
New
foxtrottwist
A few weeks ago I started using Warp a terminal written in rust. Though in it’s current state of development there are a few caveats (tab...
New
PragmaticBookshelf
Rails 7 completely redefines what it means to produce fantastic user experiences and provides a way to achieve all the benefits of single...
New
AstonJ
If you get Can't find emacs in your PATH when trying to install Doom Emacs on your Mac you… just… need to install Emacs first! :lol: bre...
New