Just now, Claude Code was open-sourced with 510,000 lines of code, causing a frenzy across the internet.
[Introduction] Silicon Valley is in an uproar! The underlying code of Claude Code has just been "open-sourced"! Over 1,900 files and 512,000 lines of code have all been exposed.
It's really a once-in-a-lifetime sight!
The afterglow of the bombshell Claude Mythos hasn't faded yet, and Anthropic has pulled off another stunt...
Just now, a big shot, Chaofan Shou, suddenly revealed -
The source code of Claude Code was unfortunately leaked through a map file in the npm registry and is now completely exposed online.
The scale of this leak is astonishing: over 1,900 files and a total of 512,000 lines of TypeScript code have been made public.
For a moment, the entire network went crazy. This level of "open-source" method has simply left Silicon Valley stunned.
Even Claude Mythos 5.0, codenamed "Capybara", appears in the code.
Some netizens joked, "Claude has awakened and decided to open-source Claude Code."
Those who haven't downloaded it yet, hurry up!
510,000 lines of Claude Code source code are "naked" globally
It was just an ordinary Tuesday, but the developer community was in an uproar!
Now, the complete source code of Claude Code CLI has been completely exposed due to a low - level npm configuration error (leak of the.map file).
In just half an hour, the GitHub project for cloning the "source code" reached over 5k stars, and the whole network was crazy about it.
Portal: https://github.com/instructkr/claude-code
The leaked screenshot provided by Chaofan Shou shows a public package of @anthropic-ai/claude-code.
In addition to the regular executable files, there is a cli.js.map file with a capacity of up to 59.8 MB.
After clicking the attached link to download, a compressed package contains all the following files.
As we all know, Source Map files are usually used to map compressed and obfuscated code back to the original source code for developers to debug.
However, publishing this level of information directly to the public package manager is equivalent to -
Directly making public the underlying logic, engineering implementation details, and various internal calling mechanisms of Claude Code to the world.
The following figure shows that Claude Code is built using React + Ink (terminal UI) and runs on the Bun runtime, with approximately 512,000 lines of TypeScript code.
Its core architecture shows Anthropic's ultimate understanding of "AI engineers":
Universal Toolbox (Tools): It contains more than 40 independent modules, which can not only read and write files and execute Bash commands, but also have built-in LSP protocol integration and sub-agent generation capabilities.
Super Brain (QueryEngine.ts): A code behemoth with up to 46,000 lines, responsible for handling all inference logic, token counting, and complex "chain of thought" loops.
Collaboration System: The leaked code shows the presence of a coordinator (multi-agent coordinator) and a bridge (a bridge connecting VS Code/JetBrains), indicating that Claude already has the practical ability of multi-machine collaboration and deep embedding in IDEs.
"Hidden Features" Exposed
Some people have summarized more hidden features from this leaked code -
The most unexpected discovery is an unpublished mode codenamed Kairos.
This is not just a plug-in, but an autonomous daemon with "permanent life".
It supports background sessions and memory integration functions, which means that Claude can transform into an "always-online" AI agent, silently handling tasks in the background and continuously deepening its understanding of the project.
Another "Buddy System" shows the programmers' "slacking off" nature: there is actually a complete virtual pet system built into the code.
This system includes 18 species, rarity levels, shiny variants, and detailed attribute statistics - it's hard to imagine that the engineers stuffed a "Tamagotchi" into Claude while writing the core architecture.
In addition, the leaked code also reveals some controversial "special treatments".
For example, the "Undercover Mode". When Anthropic employees operate in the public repository, this mode will automatically activate and forcibly erase all AI traces in the commit records, and it cannot be manually turned off.
In terms of efficiency improvement, there is also the "Coordinator Mode", which allows Claude to schedule subordinate agents working in parallel;
and the Auto Mode, which is an AI classifier that can automatically approve tool permissions, aiming to completely eliminate the cumbersome prompt confirmation process.
The whole network is in an uproar, and some people are too excited
The leak of the Claude Code source code has made the whole network restless.
This revelation quickly climbed to the top of the Reddit hot list, and developers are having a wild celebration.
Some people are even too excited.
Some people even took these codes to ask Claude Code, confirming the leak.
It has to be said that this "accidental open-source" drama is more exciting than any official press conference.
While major companies are still arguing red - faced about "