Entire Claude Code CLI source code leaks thanks to exposed map file
The entire source code for Anthropic’s Claude Code CLI has leaked due to an internal error during a package release. This includes nearly 2,000 TypeScript files and over 512,000 lines of code, exposing the application’s inner workings to competitors and developers. Anthropic has acknowledged the mistake and stated it was not a security breach.
- A packaging error in Claude Code v2.1.88 exposed a source map, leaking the entire ~2,000-file, 512,000+ line TypeScript codebase.
- The leaked code was quickly archived and uploaded to GitHub, gaining tens of thousands of forks within a short time.
- Anthropic says no customer data was exposed and calls it human error, not a security breach, while adding safeguards.
- Developers have already begun reverse-engineering internals, like Claude Code's memory architecture and background memory rewriting system.
Anthropic's Claude Code command line interface source code has leaked due to a packaging error in their recent version 2.1.88 release. This leak, which includes nearly 2,000 TypeScript files and over 512,000 lines of code, poses a significant challenge for Anthropic, a company that has been rapidly growing in the AI sector. The source map file that caused the leak was embedded in the npm package, allowing anyone to access the code.
Security researcher Chaofan Shou was the first to highlight the issue on X, leading to the codebase being archived and subsequently uploaded to GitHub, where it has already been forked tens of thousands of times. Anthropic confirmed the leak, clarifying that no sensitive customer data was compromised and labeling the incident as a result of human error rather than a security breach. They stated they are implementing measures to prevent future occurrences.
Developers have wasted no time analyzing the leaked code. One contributor, @himanshustwts, shared an in-depth overview of Claude Code’s memory architecture, detailing systems like background memory rewriting and validation procedures for memory use. This rapid dissection of the code highlights the competitive implications of the leak and the interest in understanding how Claude Code operates.