Anthropic accidentally exposed Claude's source code through npm source maps, JSON files that contain raw source code. A developer already built a Rust version based on the leaked code, showing how the model works.
Chapters
Breaking news, Claude Code source code just got leaked by Anthropic on accident. And now people have saved a copy of it. They definitely didn't expect this to happen. How did this even happen? When you publish a JavaScript or TypeScript package to npm, that's the build toolchain, it often generates source map files. These files act as a bridge between the minified, bundled production code and the original source code. They exist so that when something crashes in production, the trace can point you to the actual line of code in the original file, not some unintelligible line on some random column on some minified blob. And the fun part is that source maps contain the original source code, the actual literal raw source code embedded as strings inside a JSON file. Somebody already made a version of Claude code in Rust with a breakdown of how it works. It's in this repo. If you want access to this Claude code from source code re-implemented in Rust, drop a comment saying code, make sure you're following, like this, and I'll send you a link to this repo. Can't believe Anthropic did this.