Claude Code's Source Code Just Leaked. Here's What It Reveals About How You Should Be Using It.
TL;DR
Anthropic accidentally leaked Claude Code's full 512,000-line TypeScript source code via a source map file in their npm package
The leak reveals Claude Code is a full agent runtime with 11 architectural layers, not a chatbot wrapper. Most users are touching about 10% of its capability
We built an interactive guide breaking down the nine biggest insights from the architecture. Three are free, the rest require an email
Two leaks in a week. That's a rough stretch for Anthropic.
Last week it was Mythos, their unreleased model tier above Opus. This time it's something arguably more revealing: the actual source code for Claude Code.
VentureBeat reported that a JavaScript source map file was accidentally included in the npm package for Claude Code version 2.1.88. By the time anyone noticed, the full 512,000-line TypeScript codebase was mirrored across GitHub and being analysed by thousands of developers.
Anthropic confirmed it. "A release packaging issue caused by human error, not a security breach." No customer data exposed. No credentials compromised. Just the entire codebase for a product generating $2.5 billion in annual recurring revenue, sitting in plain view.
The reaction was immediate. 60,000 people forked the repository overnight. Anthropic filed DMCA takedowns. One developer rewrote the entire thing in Python and then Rust at 4am to sidestep the copyright claim.
That's all interesting. But it's not the part that matters to you.
What the source code actually shows
Here's the thing most people miss about Claude Code. They think it's a chatbot in their terminal. Type a prompt, get a response, type another prompt.
That's like buying a Ferrari and only driving it in first gear.
The source code reveals 11 distinct architectural layers. A tool system with 60+ built-in tools. A multi-agent coordinator. A persistent memory system. An extension API with 25+ lifecycle events. A task manager. A permission engine. An MCP client and server.
It's not a wrapper around a language model. It's a full agent orchestration platform that happens to run in your terminal.
Most people interact with exactly one of those 11 layers: the chat interface.
We went through the architecture and pulled out the nine insights that actually change how you use the tool. The full interactive breakdown is here.
Three things that change immediately
You don't need to read 512,000 lines of TypeScript to get value from this. Three things stood out as the highest leverage.
1. There's a config file that gets loaded every single turn.
It's called CLAUDE.md. You get 40,000 characters. Most people use about 200, if they use it at all.
Every time you send a message, Claude Code re-reads this file. Your architecture decisions, coding conventions, file patterns, "never do this" rules. All of it, injected into every single interaction.
This is the difference between Claude Code being a generic assistant and Claude Code being your assistant that knows your codebase. If you do one thing after reading this, it's configuring that file properly.
2. There are 85+ slash commands. Most people know maybe /help.
The source code reveals a full command service. /plan puts Claude into planning mode, where it maps out the approach before touching any code. /compact compresses your conversation history like a manual save point. /review runs a structured code review. /cost shows what you've actually spent.
/plan alone will change your workflow. Instead of Claude charging ahead and editing files in the wrong direction, it plans first. You review. Then it executes. Saves tokens. Saves time. Saves you from undoing things.
3. Every time Claude asks "Allow this action?" that's a configuration failure.
The permission system was designed to be configured, not clicked through. You can set glob patterns in your settings file: always allow git commands, always allow edits in your source directory, always allow your test runner.
Configure it once. Stop babysitting every action.
Each of these has a hands-on walkthrough in the full guide.
Why this matters beyond the dev tools crowd
If you're reading this and thinking "I don't care about developer tools," stay with me.
The tool you use to build AI systems matters as much as the model inside it. We wrote about this when Anthropic shipped 74 releases in 52 days. The pace of improvement on the harness, the thing that wraps around the model and makes it useful, is accelerating as fast as the models themselves.
When the Mythos model eventually ships, the people who get value from it won't be the ones with access to the model. Everyone will have access. The ones who get value will be the ones who already have their IP structured, their architecture configured, and their development environment tuned.
This is what AI orchestration actually looks like in practice. Not just picking the right model. Building the right environment around it.
Claude Code's source code just showed us exactly how Anthropic thinks about that environment. Eleven layers of architecture. Not one.
What to do about it
Three actions. All practical.
Read the guide. We built an interactive Claude Code power user guide that breaks down all nine architectural insights. The first three are free. The rest require an email. It's the most thorough breakdown of what the source code reveals about how to actually use the tool.
Update your installation. If you're running Claude Code via npm, switch to the native installer. Anthropic recommends curl -fsSL https://claude.ai/install.sh | bash going forward. The native binary doesn't depend on the npm supply chain and auto-updates with security patches.
Check for the supply-chain attack. This one's important. A separate attack on the axios npm package happened hours before the Claude Code leak. If you installed or updated via npm on March 31 between 00:21 and 03:29 UTC, check your lockfiles for axios versions 1.14.1 or 0.30.4. If you find either, rotate your secrets and treat the machine as compromised.
The bigger picture
Two leaks in a week. A model tier above Opus. A full agent runtime disguised as a terminal chat.
Anthropic is building something much more sophisticated than most people realise. And the gap between how the tool is designed to be used and how most people actually use it is enormous.
That gap is your advantage. If you close it.
Start with the guide. Nine insights. The first three are free. The rest are worth the email.
Sources:
Frequently Asked Questions
James Killick
Founder
The AI Orchestrator. 10+ years building digital products and 200+ apps shipped, now helping $1M+ educators and consultants turn their IP into AI-powered delivery systems.
James Killick founded and runs The AI Orchestrators.
More from James Killick