Security researcher Chaofan Shou discovered that Anthropic shipped a source map file (`.map`) inside Claude Code's npm package (v2.1.88) — a 57MB file that mapped back to the full, unobfuscated TypeScript source. The file pointed to a zip archive on Anthropic's Cloudflare R2 bucket, exposing 1,900 files and 512,000 lines of code. Within hours, the codebase was mirrored to a public GitHub repo that racked up 1,100+ stars and 1,900+ forks.
What the code revealed is arguably more interesting than the leak itself. Claude Code isn't just an API wrapper — it's a production-grade agentic system: ~40 permission-gated tools, a 46,000-line query engine handling all LLM calls, multi-agent orchestration that spawns sub-agents with isolated contexts, and a bidirectional JWT-authenticated bridge to VS Code and JetBrains. It runs on Bun (not Node.js), uses React with Ink for terminal rendering, and Zod v4 for schema validation. The architecture reveals just how much engineering goes into making "AI that writes code" actually work safely.
Anthropic's response: human error in a release packaging step, not a security breach. No customer data or credentials were exposed. The fix is trivial, exclude `.map` files from npm publishes, but the damage is done. Competitors now have a detailed blueprint of how a leading AI coding tool is built.
SO WHAT This is a masterclass in why build pipelines matter. One misconfigured `.npmignore` or `package.json` `files` field and your entire proprietary codebase is public. If you ship anything to npm, run `npm pack --dry-run` before every publish. If you're an AI startup, your architecture is now the product, and Anthropic just open-sourced theirs by accident.
ACTION ITEM If you maintain npm packages at work, audit your publish pipeline today. Check that source maps, internal configs, and test fixtures aren't shipping to the registry. It takes 5 minutes and could save your company from this exact headline.