The Claude Code Leak: A Complete Technical & Security Investigation
Abstract
On March 31, 2026, Anthropic's Claude Code CLI (@anthropic-ai/claude-code) had its complete proprietary source code, 512,664 lines across ~1,900 TypeScript files, accidentally published to the public internet via a source map file (.map) included in the production npm package. The map file referenced a publicly accessible Cloudflare R2 bucket containing the full unobfuscated source archive. This report provides a comprehensive technical and security analysis of the incident, covering: the build pipeline misconfiguration that caused the leak; the complete architecture and tool system exposed; unreleased product features and internal roadmap items discovered via 80+ feature flags; employee-only functionality withheld from paying users; CVE-2026-21852, a separately disclosed API key exfiltration vulnerability patched in v2.0.65; and two cache bugs causing 10–20× token over-billing for affected users. The leak was accidental and not a breach of Anthropic's servers. Remediation measures were applied promptly but were insufficient to prevent permanent public archiving of the source code.
Fields of Study & Subjects
Security and Verification in Computing
Web Application Security Vulnerabilities
Scientific Computing and Data Management
Publication details
- Journal / source
- SSRN Electronic Journal
- Publisher
- Elsevier BV
- Publication date
- 1 January 2026
- Document type
- Preprint