Live data from Hacker News

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

twitter.com

711–720 of 1001 posts

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

#711

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…

> This should be at minimum 8–10 separate modules. Can't really say that for sure. The way humans structure code isn't some ideal best possible state of computer code, it's the ideal organization of computer code for human coders . Nesting and cyclomatic complexity are indicators ("code smells"). They aren't guaranteed to lead to worse outcomes. If you have a function with 12 levels of nesting, but in each nest the f…

> One thing we know for sure is LLMs write code differently than we do.

Kind of. One thing we do know for certain is that LLMs degrade in performance with context length. You will undoubtedly get worse results if the LLM has to reason through long functions and high LOC files. You might get to a working state eventually, but only after burning many more tokens than if given the right amount of context.

> The worst outcome I can imagine would be forcing them to code exactly like we do.

You're treating "code smells" like cyclomatic complexity as something that is stylistic preference, but these best practices are backed by research. They became popular because teams across the industry analyzed code responsible for bugs/SEVs, and all found high correlation between these metrics and shipping defects.

Yes, coding standards should evolve, but... that's not saying anything new. We've been iterating on them for decades now.

I think the worst outcome would be throwing out our collective wisdom because the AI labs tell us to. It might be good to question who stands to benefit when LLMs aren't leveraged efficiently.

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

#712

It's a little bit shocking that this zipfile is still available hours later. Could anyone in legal chime in on the legality of now 're-implementing' this type of system inside other products? Or even just having an AI look at the architecture and implement something else? It would seem given the source code that AI could clone something like this incredibly fast, and not waste it's time using ts as well. Any Legal GC…

there are python ports up on gihthub

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

#713

Earlier quoted context omitted.

I wish. Claude Code is clearly a pile of vibe-coded garbage. The UI is janky and jumps all over the place, especially during longer sessions. (Which also have a several second delay to render. In a terminal). Lately, it's been crashing if I hold the Backspace key down for too long. Being open-source would be the best thing to happen to them. At least they would finally get a pair of human eyes looking at their codeba…

> Claude Code is clearly a pile of vibe-coded garbage. The UI is janky and jumps all over the place, especially during longer sessions. (Which also have a several second delay to render. In a terminal). Don't you know, they're proud of their text interface that is structured more like a video game. https://spader.zone/engine/

I mean if you want glitchy garbage that works in the happy path mostly then game engine is the right foundation to build on. Software quality is the last thing game devs are known for. The whole industry is about building clever hacks to get something to look/feel a certain way, not building robust software that's correct to some spec.

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

#714
post #567

Earlier quoted context omitted.

Fatalism will also not fix anything. But I suppose death comes for us all, yes? Why do anything at all?

I feel that fatalism, especially when people treat it as some sort of personal philosophy, is kind of lazy. It requires no effort to say "fuck this, nothing matters anyway", and then justify doing literally nothing.

> I feel that fatalism, especially when people treat it as some sort of personal philosophy, is kind of lazy.

I think a lot of fatalism is fake. It's really someone saying "I like this, and I want you to believe you can't change it so you give up."

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

#715

Earlier quoted context omitted.

here's another gem. src/ink/termio/osc.ts:192–210 void execFileNoThrow('wl-copy', [], opts).then(r => { if (r.code === 0) { linuxCopy = 'wl-copy'; return } void execFileNoThrow('xclip', ...).then(r2 => { if (r2.code === 0) { linuxCopy = 'xclip'; return } void execFileNoThrow('xsel', ...).then(r3 => { linuxCopy = r3.code === 0 ? 'xsel' : null }) }) }) are we doing async or not?

A defining work of the "just vibes" era.

You fail to mention the prior decades of really bad software engineers writing awful code -- off of which these models trained.

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

#716

Earlier quoted context omitted.

> Write commit messages as a human developer would — describe only what the code change does. The undercover mode prompt was generated using AI.

All these companies use AIs for writing these prompts. But AI aren't actually very good at writing prompts imo. Like they are superficially good in that they seem to produce lots of vaguely accurate and specific text. And you would hope the specificity would mean it's good. But they sort of don't capture intent very well. Nor do they seem to understand the failure modes of AI. The "-- describe only what the code chan…

AI is better at writing prompts than most humans. It requires work and lots of developers don’t think getting good at prompting actually matters.

At least half of the complaints I see on HN boil down to the person's prompts suck. Or the expectation that AI can read their mind.

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

#717

Earlier quoted context omitted.

I wish. Claude Code is clearly a pile of vibe-coded garbage. The UI is janky and jumps all over the place, especially during longer sessions. (Which also have a several second delay to render. In a terminal). Lately, it's been crashing if I hold the Backspace key down for too long. Being open-source would be the best thing to happen to them. At least they would finally get a pair of human eyes looking at their codeba…

As a point of reference, I’m a heavy cc user and I’ve had a few bugs but I’ve never had the terminal glitches like this. I use iterm on macOS sequoia.

i will note that they really should of used something like ncurses and kept the animations down, TTYs are NOT meant to do the level of crazy modern TUIs are trying to pull off, there is just too many terminal emulators out there that just don't like the weird control codes being sent around.

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

#718

Earlier quoted context omitted.

Always seems strange to me that people say "please" and "thank you" to LLMs.

It actually works really well if you suck up to the AI. "Please do x" "Thank you, that works great! Please do y now." "You're so smart!" lol. It really works though! At least in my experience, Claude gets almost hostile or "annoyed" when I'm not nice enough to it. And I swear it purposefully acts like a "malicious genie" when I'm not nice enough. "It works, exactly like you requested, but what you requested is stupid…

What really works? Sycophancy? I think that is a bug, not a feature.

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

#719
post #569
post #537

Earlier quoted context omitted.

Oh it’s worse than that. This one ended up getting my account banned: https://github.com/anthropics/claude-code/issues/22284

This is a tricky problem, I mean, Pinyin also uses the English alphabet.

It is not a tricky problem because it has a simple and obvious solution: do not filter or block usage just because the input includes a word like "gun".

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

#720
post #684
post #134

Earlier quoted context omitted.

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.

I can prove all contributions to stagex are by humans because we all belong to a 25 year old web of trust with 5444 endorser keys including most redhat, debian, ubuntu, and fedora maintainers, with all of our own maintainer keys in smartcards we tap to sign every review and commit, and we do background checks on every new maintainer. I am completely serious. We have always had a working proof of human system called W…

You can prove the commits were signed by a key you once verified. It is your trust in those people which allows you to extend that to “no LLM” usage, but that’s reframing the conversation as one of trust, not human / machine. Which is (charitably) GPs point: stop framing this as machine vs human — assume (“accept”) that all text can be produced by machines and go from there: what now? That’s where your proposal is one solution: strict web of trust. It has pros and cons (barrier to entry for legitimate first timers), but it’s a valid proposal.

All that to say “you’re not disagreeing with the person you’re replying to” lol xD

Post reply on HN