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 ?
Claude Code's source code has been leaked via a map file in their NPM registry
181–190 of 1001 posts
Re: Claude Code's source code has been leaked via a map file in their NPM registry
#182Maybe 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 ?
Don't worry about that, the code in that repository isn't Anthropic's to begin with.
Re: Claude Code's source code has been leaked via a map file in their NPM registry
#183Re: Claude Code's source code has been leaked via a map file in their NPM registry
#184Earlier quoted context omitted.
the "useCanUseTool.tsx" hook, is definitely something I would hate seeing in any code base I come across. It's extremely nested, it's basically an if statement soup `useTypeahead.tsx` is even worse, extremely nested, a ton of "if else" statements, I doubt you'd look at it and think this is sane code
I'm not that familiar with TypeScript/JavaScript - what would be a proper way of handling complex logic? Switch statements? Decision tables?
Re: Claude Code's source code has been leaked via a map file in their NPM registry
#185They 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.
Re: Claude Code's source code has been leaked via a map file in their NPM registry
#186Really surprising how many people are downplaying this leak! "Google and OpenAi have already open sourced their Agents, so this leak isn't that relevant " What Google and OpenAi have open sourced is their Agents SDK, a toolkit, not the secret sauce of how their flagship agents are wired under the hood! expect the takedown hammer on the tweet, the R2 link, and any public repos soon
Re: Claude Code's source code has been leaked via a map file in their NPM registry
#187Earlier quoted context omitted.
Random aside: I've seen a 2015 game be accused of AI slop on Steam because it used a similar concept... And mind you, there's probably thousands of games that do this. First it was punctuation and grammar, then linguistic coherence, and now it's tiny bits of whimsy that are falling victim to AI accusations. Good fucking grief
To me, this is a sign of just how much regular people do not want AI. This is worse than crypto and metaverse before it. Crypto, people could ignore and the dumb ape pictures helped you figure out who to avoid. Metaverse, some folks even still enjoyed VR and AR without the digital real estate bullshit. And neither got shoved down your throat in everyday, mundane things like writing a paper in Word or trying to deal w…
Re: Claude Code's source code has been leaked via a map file in their NPM registry
#188They 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.
You have a semi expensive process. But you want to keep particular known context out. So a quick and dirty search just in front of the expensive process. So instead of 'figure sentiment (20seconds)'. You have 'quick check sentiment (I could see me totally making a design choice like that.
Re: Claude Code's source code has been leaked via a map file in their NPM registry
#189Re: Claude Code's source code has been leaked via a map file in their NPM registry
#190src/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 ?