Anthropic's 512k Claude Code Lines Exposed Due to Missing .npmignore Entry

Anthropic just shipped 512,000 lines of Claude Code source to npm — because of ONE missing line in .npmignore. No CVE. No breach. Just a 59.8 MB source map sitting in a public package. Here's what actually happened: → Bun generates source maps by default → The npm package was missing `.map` in .npmignore → Researcher Chaofan Shou found it within hours → The map pointed to a zip on Anthropic's own cloud storage → 1,900 files of unobfuscated TypeScript — the full repo Then the internet did what the internet does. A clean-room rewrite hit 50,000 GitHub stars in 2 hours. Reportedly the fastest-growing repo in GitHub history. Anthropic's statement: "release packaging issue caused by human error, not a security breach." Technically correct. Strategically catastrophic. The architecture of the fastest-growing dev tool of 2026 is now public domain. Why this matters for every developer shipping npm packages: - Source maps are ON BY DEFAULT in Bun, webpack, Vite, esbuild, Rollup - One missing .npmignore entry bundles your entire codebase - "Not a breach" and "total IP exposure" can be the same event - Your build pipeline is now your biggest trade-secret risk Three things to add to your CI today: 1. `npm pack --dry-run` — list every file before publish 2. Add `.map`, `.map.js`, `.ts`, `src/` to .npmignore 3. Set `sourcemap: false` for production builds, or use `hidden-source-map` If Anthropic's engineers missed it, your team will too. The scariest part? This wasn't sophisticated. It was one line of config. Check your next npm publish. Run the dry-run. Read every file in the tarball. Because the difference between shipping a library and shipping your company is sometimes just one glob pattern. If you found this useful, repost — someone in your network is one `npm publish` away from the same mistake. #npm #DevOps #SoftwareEngineering #ClaudeCode #SupplyChainSecurity

  • No alternative text description for this image

To view or add a comment, sign in

Explore content categories