Live data from Hacker News

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

twitter.com

231–240 of 1001 posts

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

#231

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…

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?

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

#232
post #19

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/

This has happened before. It was called anon kode.

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

#233
post #163
post #138

Earlier quoted context omitted.

That’s what they do. Ever heard of a hand truck?

I never knew the name of that device. Thanks

Depending on the region you live in, it's also frequently called a "dolly"

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

#234
post #84

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...

Ridiculous string comparisons on long chains of logic are a hallmark of vibe-coding.

Nah, it's a hallmark of your average codebase in pre-LLM era.

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

#235
post #84

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...

An LLM company using regexes for sentiment analysis? That's like a truck company using horses to transport parts. Weird choice.

They had the problem of sentiment analysis. They use regexes.

You know the drill.

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

#237
post #82

Earlier quoted context omitted.

https://github.com/instructkr/claude-code this one has more stars and more popular

Popular, yes... but have you seen the issues? SOMETHING is going on in that repo: https://github.com/instructkr/claude-code/issues

Looks like mostly spam making fun of the code leak.

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

#238
post #95
post #86

Earlier quoted context omitted.

won't they just try to dmca or take these down especially if they're more popular

They can't. AI generated code cannot be copyrighted. They've stated that claude code is built with claude code. You can take this and start your own claude code project now if you like. There's zero copyright protection on this.

Try not to be overly confident about things where even the experts in the field (copyright lawyers) are uncertain of.

There's no major lawsuits about this yet, the general consensus is that even under current regulations it's in the grey. And even if you turn out to be right, and let's say 99% of this code is AI-generated, you're still breaking the law by using the other 1%, and good luck proving in court what parts of their code were human written and what weren't (especially when being sued by the company that literally has the LLM logs).

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

#239

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

What's going on with the issues in that repo? https://github.com/instructkr/claude-code/issues

oh wow, there are like 10 opened every minute. seems spam-y
Post reply on HN