Anthropic’s AI coding tool, Claude Code, accidentally reveals its source code; here’s what happened
Anthropic, the San Francisco-based artificial intelligence (AI) company, on Tuesday (local time), inadvertently exposed the entire source code of Claude Code, its AI coding tool, NDTV reported.
The source code was exposed due to a basic packaging oversight that, according to security researchers, should never happen in a finished software product.
Security researcher Chaofan Shau on Tuesday found that Claude Code, the AI company’s flagship command-line coding tool, exposed its full source code. The issue stemmed from a 60MB source file map (cli.js.map) bundled within its npm package, which made it possible to recreate the original TypeScript code from the compiled version, the report added.
The npm registry, where the file was hosted, is the largest public repository for software packages and is widely used by developers to distribute and access tools.
What did the source code reveal?
The source code revealed the internal workings of the agentic AI platform. According to media reports, within hours, thousands of developers copied and reposted the approximately 512,000-line TypeScript codebase on GitHub, closely examining its features and internal memory architecture that had previously been accessible only to Anthropic’s engineers.
According to BlockBeats, the leak only affects part of the Claude Code tool itself and does not include user data or the AI’s core systems, so it doesn’t pose a direct risk to regular users. In simple terms, your personal information and chats are safe. However, because the full code is now visible, anyone can see how the tool is built, how it works behind the scenes, and how it handles things like usage tracking and security.
What is source code?
According to the NDTV report, source code is the original, human-readable set of instructions that developers write to create software. When companies release software publicly, the code is usually compiled or packaged into a more compact and less readable form to safeguard a company’s intellectual property and internal logic.
A source map is an additional file used in development that links a program’s compressed, production-ready code back to its original, human-readable version. It helps developers debug and troubleshoot issues more efficiently. However, such files are not meant to be included in public releases, as they can effectively expose the entire underlying codebase.
According to BlockBeats, the latest version of Claude Code (v2.1.88), released on 31 March, still included this file. It reportedly contained the full code for 1,906 proprietary source files, detailing elements such as internal API structures, telemetry systems, encryption mechanisms, and inter-process communication protocols.
Second exposure in a year
Reports suggest that this is not the first time that the AI company has exposed its source code. According to Odaily, a blockchain-focused media platform, back in February 2025, an early version of Claude Code was exposed due to the same reason. At the time, Anthropic removed the old version from the npm and deleted the source map.
Post Comment