Live data from Hacker News

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

twitter.com

221–230 of 1001 posts

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

#222

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, wo…

Yes, if it was made for human comprehension or maintenance. If it's entirely generated / consumed / edited by an LLM, arguably the most important metric is... test coverage, and that's it ?

Oh boy, you couldn't be more wrong. If something, LLM-s need MORE readable code, not less. Do you want to burn all your money in tokens?

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

#223
post #210

Earlier quoted context omitted.

They probably have statistics on it and saw that certain phrases happen over and over so why waste compute on inference.

The problem with regex is multi-language support and how big the regex will bloat if you to support even 10 languages.

Did you just complain about bloat, in anything using npm?

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

#224
post #214

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

I'm glad "reticulating" is in there. Just need to make sure "splines" is in the nouns list!

Relieved to know I'm not the only one who grepped for that. Thank you for making me feel sane, friend.

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

#225

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, wo…

Yes, if it was made for human comprehension or maintenance. If it's entirely generated / consumed / edited by an LLM, arguably the most important metric is... test coverage, and that's it ?

Can't wait to have LLM generated physical objects that explode on you face and no engineer can fix.

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

#226
post #194

Earlier quoted context omitted.

Because they want it to be executed quickly and cheaply without blocking the workflow? Doesn’t seem very weird to me at all.

It looks like it's just for logging, why does it need to block?

Better question - why would you call an LLM (expensive in compute terms) for something that a regex can do (cheap in compute terms)

Regex is going to be something like 10,000 times quicker than the quickest LLM call, multiply that by billions of prompts

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

#227

Maybe the OP could clarify, I don't like reading leaked code, but I'm curious: my understanding is that is it the source code for "claude code", the coding assistant that remotely calls the LLMs. Is that correct ? The weights of the LLMs are _not_ in this repo, right ? It sure sucks for anthropic to get pawned like this, but it should not affect their bottom line much ?

[deleted]

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

#228
post #210

Earlier quoted context omitted.

They probably have statistics on it and saw that certain phrases happen over and over so why waste compute on inference.

The problem with regex is multi-language support and how big the regex will bloat if you to support even 10 languages.

We're talking about Claude Code. If you're coding and not writing or thinking in English, the agents and people reading that code will have bigger problems than a regexp missing a swear word :).

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

#229
post #134

Undercover mode also pretends to be human, which I'm less ok with: https://github.com/chatgptprojects/claude-code/blob/642c7f94...

You'll never win this battle, so why waste feelings and energy on it? That's where the internet is headed. There's no magical human verification technology coming to save us.

Even if it is impossible to win, I am still feeling bad about it.

And at this point it is more about how large space will be usable and how much will be bot-controlled wasteland. I prefer spaces important for me to survive.

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

#230

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

LLMs are good in JS and Python which means everything from now on will be written in or ported to either of those two languages. So yeah, JS is the future of all software.

This is a common take but language servers bridge the gap well.

Language servers, however, are a pain on Claude code. https://github.com/anthropics/claude-code/issues/15619

Post reply on HN