logoalt Hacker News

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

259 pointsby treexstoday at 9:00 AM121 commentsview on HN

Comments

bkryzatoday at 10:39 AM

They have an interesting regex for detecting negative sentiment in users prompt which is then logged (explicit content): https://github.com/chatgptprojects/claude-code/blob/642c7f94...

I guess these words are to be avoided...

show 6 replies
treexstoday at 9:17 AM

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

show 2 replies
kschiffertoday at 11:10 AM

Finally all spinner verbs revealed: https://github.com/instructkr/claude-code/blob/main/src/cons...

show 1 reply
avaertoday at 9:34 AM

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/

show 1 reply
lukantoday at 10:04 AM

Neat. Coincidently recently I asked Claude about Claude CLI, if it is possible to patch some annoying thing (like not being able to expand Ctrl + O more than once, so never be able to see some lines and 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.

gman83today at 11:06 AM

Gemini CLI and Codex are open source anyway. I doubt there was much of a moat there anyway. The cool kids are using things like https://pi.dev/ anyway.

Squarextoday at 10:01 AM

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.

show 1 reply
mohsen1today at 10:57 AM

src/cli/print.ts

This is the single worst function in the codebase by every metric:

  - 3,167 lines long (the file itself is 5,594 lines)
  - 12 levels of nesting at its deepest
  - ~486 branch points of cyclomatic complexity
  - 12 parameters + an options object with 16 sub-properties
  - Defines 21 inner functions and closures
  - Handles: agent run loop, SIGINT, rate-limits, AWS auth, MCP lifecycle, plugin install/refresh, worktree bridging, team-lead polling (while(true) inside), control message dispatch (dozens of types), model switching, turn interruption
  recovery, and more
This should be at minimum 8–10 separate modules.
show 1 reply
cedwstoday at 10:28 AM

    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.
karimftoday at 9:46 AM

Is there anything special here vs. OpenCode or Codex?

There were/are a lot of discussions on how the harness can affect the output.

cbracketdashtoday at 10:29 AM

Once the USA wakes up, this will be insane news

show 1 reply
mesmertechtoday at 10:43 AM

Was searching for the rumored Mythos/Capybara release, and what even is this file? https://github.com/chatgptprojects/claude-code/blob/642c7f94...

show 2 replies
bob1029today at 9:20 AM

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.

show 1 reply
dhruv3006today at 10:09 AM

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.

vbezhenartoday at 9:29 AM

LoL! https://news.ycombinator.com/item?id=30337690

Not exactly this, but close.

theanonymousonetoday at 10:02 AM

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

mapcarstoday at 9:09 AM

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

show 2 replies
Diablo556today at 10:52 AM

haha.. Anthropic need to hire fixer from vibecodefixers.com to fix all that messy code..lol

jedisct1today at 10:53 AM

It shows that a company you and your organization are trusting with your data, and allowing full control over your devices 24/7, is failing to properly secure its own software.

It's a wake up call.

show 2 replies
LeoDaVibecitoday at 9:11 AM

Isn't it open source?

Or is there an open source front-end and a closed backend?

show 5 replies
ChicagoDavetoday at 10:11 AM

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

anhldbktoday at 10:04 AM

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

show 1 reply
q3ktoday at 9:19 AM

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

show 4 replies
DeathArrowtoday at 10:12 AM

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

show 2 replies
DeathArrowtoday at 10:05 AM

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

show 2 replies
isodevtoday at 10:15 AM

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.

show 3 replies
mergeshieldtoday at 9:52 AM

[dead]

kevinbaivtoday at 10:10 AM

[dead]

psihonauttoday at 10:38 AM

[dead]

sixhobbitstoday at 10:08 AM

[dead]