Claude Code's source code has been leaked via a map file in their NPM registry

treexs 1950 points 956 comments March 31, 2026
twitter.com · View on Hacker News

https://xcancel.com/Fried_rice/status/2038894956459290963 Related ongoing thread: The Claude Code Source Leak: fake tools, frustration regexes, undercover mode - https://news.ycombinator.com/item?id=47586778

Discussion Highlights (20 comments)

mapcars

Are there any interesting/uniq features present in it that are not in the alternatives? My understanding is that its just a client for the powerful llm

LeoDaVibeci

Isn't it open source? Or is there an open source front-end and a closed backend?

treexs

The big loss for Anthropic here is how it reveals their product roadmap via feature flags. A big one is their unreleased "assistant mode" with code name kairos. Just point your agent at this codebase and ask it to find things and you'll find a whole treasure trove of info. Edit: some other interesting unreleased/hidden features - The Buddy System: Tamagotchi-style companion creature system with ASCII art sprites - Undercover mode: Strips ALL Anthropic internal info from commits/PRs for employees on open source contributions

q3k

The code looks, at a glance, as bad as you expect.

bob1029

Is this significant? Copilot on OAI reveals everything meaningful about its functionality if you use a custom model config via the API. All you need to do is inspect the logs to see the prompts they're using. So far no one seems to care about this "loophole". Presumably, because the only thing that matters is for you to consume as many tokens per unit time as possible. The source code of the slot machine is not relevant to the casino manager. He only cares that the customer is using it.

vbezhenar

LoL! https://news.ycombinator.com/item?id=30337690 Not exactly this, but close.

avaer

Would be interesting to run this through Malus [1] or literally just Claude Code and get open source Claude Code out of it. I jest, but in a world where these models have been trained on gigatons of open source I don't even see the moral problem. IANAL, don't actually do this. https://malus.sh/

karimf

Is there anything special here vs. OpenCode or Codex? There were/are a lot of discussions on how the harness can affect the output.

bryanhogan

https://xcancel.com/Fried_rice/status/2038894956459290963

dheerajmp

Source here https://github.com/chatgptprojects/claude-code/

Squarex

Codex and gemini cli are open source already. And plenty of other agents. I don't think there is any moat in claude code source.

theanonymousone

I am waiting now for someone to make it work with a Copilot Pro subscription.

anhldbk

I guess it's time for Anthropic to open source Claude Code.

lukan

Neat. Coincidently recently I asked Claude about Claude CLI, if it is possible to patch some annoying things (like not being able to expand Ctrl + O more than once, so never be able to see some lines and in general have more control over the context) and it happily proclaimed it is open source and it can do it ... and started doing something. Then I checked a bit and saw, nope, not open source. And by the wording of the TOS, it might brake some sources. But claude said, "no worries", it only break the TOS technically. So by saving that conversation I would have some defense if I would start messing with it, but felt a bit uneasy and stopped the experiment. Also claude came into a loop, but if I would point it at this, it might work I suppose.

DeathArrow

I wonder what will happen with the poor guy who forgot to delete the code...

dhruv3006

I have a feeling this is like llama. Original llama models leaked from meta. Instead of fighting it they decided to publish them officially. Real boost to the OS/OW models movement, they have been leading it for a while after that. It would be interesting to see that same thing with CC, but I doubt it'll ever happen.

ChicagoDave

I hope everyone provides excellent feedback so they improve Claude Code.

DeathArrow

Why is Claude Code, a desktop tool, written in JS? Is the future of all software JS or Typescript?

isodev

Can we stop referring to source maps as leaks? It was packaged in a way that wasn’t even obfuscated. Same as websites - it’s not a “leak” that you can read or inspect the source code.

cedws

ANTI_DISTILLATION_CC This is Anthropic's anti-distillation defence baked into Claude Code. 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 goal: if someone is scraping Claude Code's API traffic to train a competing model, the poisoned training data makes that distillation attempt less useful.

Semantic search powered by Rivestack pgvector
3,471 stories · 32,344 chunks indexed