Anthropic Claude Code source code leaked via source map in npm package
Anthropic's Claude Code npm package version 2.1.88 accidentally included a source map file that exposed proprietary TypeScript source code. The leak was discovered on March 31, 2026, and subsequently spread across GitHub before being removed following Anthropic's DMCA takedown notices.
What happened
Anthropic's Claude Code version 2.1.88 npm package accidentally contained a source map file, exposing TypeScript source code on March 31, 2026.
The exposed code spread across GitHub, with security researcher Chaofan Xiao flagging the issue on X. GitHub subsequently removed approximately 8,100 repositories after Anthropic filed a DMCA takedown notice.
Reported impact
Anthropic stated no customer confidential data or authentication information was leaked. Developers analyzed the memory structure and attempted to reimplement the code in Python using clean-room design to avoid copyright issues.
Index analysis
Once leaked code became widely accessible, complete containment proved difficult. The exposed source code could enable vulnerability discovery and mimicry of tool design and implementation patterns by third parties.
Governance controls
Anthropic described the incident as a human error in release packaging and stated it was implementing preventive measures. The company filed DMCA takedown requests to remove the code from public repositories.
Classification
Sources and evidence
This record was researched and written by the Index, based on the following original reporting.