A Sourcemap on npm Leaked the Claude Code Source

Claude Code's source code was reconstructed from a leftover sourcemap file in its npm package—a textbook release-process blunder.

The Technical Path of the Leak

The mechanism is embarrassingly simple: the build artifacts published to npm included a sourcemap, and a sourcemap's whole job is to map minified code back to the original source—like hanging a key next to the encrypted door. Someone noticed it, reconstructed the source, and spread it, and the entire process required no "attack" at all. This is a checklist item that's been taught in frontend engineering for ten years, and its appearance in a release process at Anthropic's level can mean only one thing: the release pipeline's security checklist is missing a line, or that line exists but no one ran it.

The Lesson for Both Sides

For Anthropic, the remedial moves are predictable: pull the package, clean up, and add checks to the pipeline. For the engineers watching, this is a free compliance drill—go check whether your own published packages have the same kind of leftovers: sourcemaps, internal comments, hardcoded keys, and intranet addresses. This kind of blunder is far more common than you'd imagine. There's another layer of context worth mentioning: closed-source JS tools distributed via obfuscation were already in a "semi-transparent" state—anyone determined enough can reverse them, and a sourcemap just turns the ticket from expensive to free. Actually staking commercial secrets on obfuscation isn't a sound architectural choice to begin with.

via: Hacker News