The code looks, at a glance, as bad as you expect.
Claude Code's source code has been leaked via a map file in their NPM registry
51–60 of 1001 posts
Re: Claude Code's source code has been leaked via a map file in their NPM registry
#52Re: Claude Code's source code has been leaked via a map file in their NPM registry
#53Earlier quoted context omitted.
Can you give an example? Looks fairly decent to me
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
export function extractSearchToken(completionToken: {
token: string;
isQuoted?: boolean;
}): string {
if (completionToken.isQuoted) {
// Remove @" prefix and optional closing "
return completionToken.token.slice(2).replace(/"$/, '');
} else if (completionToken.token.startsWith('@')) {
return completionToken.token.substring(1);
} else {
return completionToken.token;
}
}
Why even use else if with return...Re: Claude Code's source code has been leaked via a map file in their NPM registry
#54The code looks, at a glance, as bad as you expect.
Honestly when using it, it feels vibe coded to the bone, together with the matching weird UI footgun quirks
Re: Claude Code's source code has been leaked via a map file in their NPM registry
#55Earlier quoted context omitted.
1. Randomly peeking at process.argv and process.env all around. Other weird layering violations, too. 2. Tons of repeat code, eg. multiple ad-hoc implementations of hash functions / PRNGs. 3. Almost no high-level comments about structure - I assume all that lives in some CLAUDE.md instead.
You're right about process.argv - wow, that looks like a maintenance and testability nightmare.
Re: Claude Code's source code has been leaked via a map file in their NPM registry
#56I wonder what will happen with the poor guy who forgot to delete the code...
Re: Claude Code's source code has been leaked via a map file in their NPM registry
#57Re: Claude Code's source code has been leaked via a map file in their NPM registry
#58Re: Claude Code's source code has been leaked via a map file in their NPM registry
#59Earlier quoted context omitted.
Can you give an example? Looks fairly decent to me
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
Re: Claude Code's source code has been leaked via a map file in their NPM registry
#60Why is Claude Code, a desktop tool, written in JS? Is the future of all software JS or Typescript?
[1] https://www.amazon.com/Programming-TypeScript-Making-JavaScr...