Anthropic's npm package shipped a source map that exposed Claude Code internals, including hidden flags, memory logic, and unreleased model codenames. The leak matters because it reveals implementation details and prompt controls behind a closed coding agent.

Matt Pocock’s initial post said a “big chunk of Claude Code’s source code” was exposed through an npm .map file, sizing it at “~512K lines of code” across “~1,900 files.” A later screenshot-based post from Wes Roth shows a cli.js.map file at 57MB and a populated src tree with files such as main.tsx, QueryEngine.ts, setup.ts, and tool, command, and component directories directory screenshot [img:2|57MB sourcemap].
That scope matters because this was not a tiny debug artifact. The HN thread frames it as a packaging failure that effectively shipped the CLI’s readable TypeScript to anyone pulling the npm package, while the linked leak post notes a direct downloadable archive circulated quickly. Separately, a repository linked from the original discussion claims to be a “clean-room” recreation built after the incident, underscoring how fast leaked client logic can be inspected and replicated clean-room repo.
The most concrete product signal is that community analysis found references to an unreleased “Capybara” model in Claude Code’s client, with TestingCatalog’s post tying it to “undercover mode.” Other posts go further, claiming strings such as “capybara-v2-fast” and even references to future Opus and Sonnet versions, but those details remain unconfirmed because they come from third-party screenshots rather than Anthropic model screenshot.
Posted by treexs
Thread discussion highlights: - jakegmaths on Bun production build bug: I think this is ultimately caused by a Bun bug which I reported, which means source maps are exposed in production... Claude code uses (and Anthropic owns) Bun, so my guess is they're doing a production build, expecting it not to output source maps, but it is. - foob on NPM packaging: they deprecated it with a message of "Unpublished" instead of actually unpublishing it... when you use npm deprecate it leaves it there and simply marks the package as deprecated with your message. - cedws on anti-distillation / fake tools: ANTI_DISTILLATION_CC ... when enabled, it injects anti_distillation: ['fake_tools'] into every API request, which causes the server to silently slip decoy tool definitions into the model's system prompt.
The HN discussion surfaces lower-level implementation details with clearer engineering relevance. One commenter says an ANTI_DISTILLATION_CC path injects anti_distillation: ['fake_tools'] into requests so the server can slip decoy tool definitions into the system prompt, a rare public look at one way an agent vendor may try to resist prompt or toolset extraction. The same thread also points to prompt-sentiment handling, and Rahat’s regex post says Claude Code detects phrases like “wtf” or “this sucks” and logs an is_negative: true analytic flag rather than changing runtime behavior. Boris Cherny later confirmed that signal exists, saying the team uses it on a dashboard they call the “fucks” chart Cherny on dashboard.
Community threads also enumerate hidden modes including “Coordinator Mode,” “Auto Mode,” and “Kairos,” described as an “autonomous daemon mode with background sessions and memory consolidation,” but those claims come from secondary reading of the leak rather than official documentation, so they are best treated as reported feature flags, not shipped capabilities AILeaks thread follow-up post.
The postmortem signal changed over the day. Early discussion on Hacker News proposed a Bun production sourcemap issue, with one commenter saying Claude Code may have been built “expecting it not to output source maps, but it is” early thread summary. Cherny later directly contradicted that theory, writing that it was “not related to bun” and was “just developer error” Cherny reply.
For AI engineers, the lasting takeaway is how much operational detail lives in the client. The HN thread called it a case study in “how an AI coding tool is packaged and protected,” because the exposed code appears to include permissioning logic, hidden employee paths, analytics hooks, and anti-distillation controls. Even without backend weights or server code, a shipped agent client can reveal architecture, eval assumptions, and product-roadmap hints that competitors and auditors can inspect immediately.
Posted by treexs
Useful as a case study in how an AI coding tool is packaged and protected: the thread surfaces a likely source-map exposure path, a Bun-related production mapping bug, and implementation details like fake-tool anti-distillation and prompt sentiment logging. It also shows how much can be inferred from shipped client code, which matters for developers building or auditing AI tooling.
Posted by treexs
Chaofan Shou (@Fried_rice) posted on 2026-03-31 that Claude Code's source code was leaked through a map file in Anthropic's NPM registry, providing a direct download link: https://pub-aea8527898604c1bbb12468b1581d95e.r2.dev/src.zip. The tweet has garnered significant engagement and discussion across platforms like Reddit and Hacker News.
Appears that a big chunk of Claude Code's source code has been exposed on npm via a .map file accidentally uploaded to the public registry. ~512K lines of code ~1,900 files HugOps to the Anthropic team, this is brutal github.com/instructkr/cla…
Earlier today, the complete, un-obfuscated TypeScript source code for Anthropic’s official Claude Code CLI tool was exposed and has been rapidly backed up by the developer community across platforms like GitHub and Reddit.
Claude code source code has been leaked via a map file in their npm registry! Code: …a8527898604c1bbb12468b1581d95e.r2.dev/src.zip
BREAKING 🚨: Claude Code source code has been leaked via the map file in Anthropic's npm registry. The code references an unreleased model named "Capybara", mentioned in the recently revealed blog post. UNDERCOVER MODE 👀
No, can confirm it was not related to bun. Just developer error
Claude Code has a regex that detects "wtf", "ffs", "piece of shit", "fuck you", "this sucks" etc. It doesn't change behavior...it just silently logs is_negative: true to analytics. Anthropic is tracking how often you rage at your AI Do with this information what you will