4 ms·
> 500k lines of code Isn't it a simple REPL with some tools and integrations, written in a very high level language? How the hell is it so big? Is it because i
by ernst_klim 6mo ago
> 500k lines of code
Isn't it a simple REPL with some tools and integrations, written in a very high level language? How the hell is it so big? Is it because it's vibecoded and LLMs strive for bloat, or is it meaningful complexity?
- fragmede 6mo agoHow many LoC should it be, for that kind of program?
- troupo 6mo agoIt's a TUI API wrapper with a few commands bolted on. I doubt it needs to be more than 20-50kloc. You can create a full 3D game with a custom 3D engine in 500k lines. What the hell is Claude Code doing?
- spiderfarmer 6mo agoComments like these remind me of the football spectators that shout "Even I could have scored that one" when they see a failed attempt. Sure. You could have. But you're not the one playing football in the Champions League. There were many roads that could have gotten you to the Champions League. But now you're in no position to judge the people who got there in the end and how they did it. Or you can, but whatever.
- boomskats 6mo agoI don't think this is warranted given that the comment you're criticising is simply expressing an opinion explicitly solicited by the comment it's responding to.
- troupo 6mo ago> Sure. You could have. But you're not the one playing football in the Champions League. The only reason people are using Claude Code is because it's the only way to use their (heavily subsidized) subscription plans. People who are okay with using and paying for their APIs often opt out for other, better, tools. Also, analogies don't work. As we know for a fact that Claude Code is a bloated mess that these "champions league-level engineers" can't fix. They literally talk about it themselves: https://news.ycombinator.com/item?id=47598488 https://news.ycombinator.com/item?id=47598488 (they had to bring in actual Champions League engineers from bun to fix some of their mess).
- spiderfarmer 6mo ago"Even I would have scored that goal" == "I would never ever have created a bloated mess like Anthropic" You just repeat the same statement. That bloated mess is what got them to the Champions League. They did what was necessary to get them here. And they succeeded so far. But hey, according to some it can be replicated in 50k lines of wrapper code around a terminal command, so for Anthropic it's just one afternoon of vibe coding to get rid of this mess. So what's the problem? /s
- troupo 6mo ago> Even I would have scored that goal" == "I would never ever have created a bloated mess like Anthropic" Since you keep putting words in my mouth that I never said, and keep being deliberately obtuse, this particular branch is over. Go enjoy Win11 written by same level of champions or something. Adieu.
- sarchertech 6mo agoIt’s more like “Player A is better than Player B” coming from a professional player in a smaller league who is certainly qualified to have that opinion.
- vardalab 6mo agoYes, exactly. I like this analogy. I am surprised the level of pearl clutching in these discussions on Hacker News. Everybody wants to be an attention sharecropper, lol.
- criley2 6mo agoHonest question: Why does it matter? They got the product shipped and got millions of paying customers and totally revolutionized their business and our industry. Engineers using LOC as a measure of quality is the inverse of managers using LOC as a measure of productivity.
- raincole 6mo agoIt doesn't. LoC is only meaningful when you use it to belittle others' code.
- ulbu 6mo agohehe, belittle (to make smaller)
- dandellion 6mo agoMore code means more entropy, more room for bugs, harder to find issues, more time to fix, more attack surface, more memory used, more duplication, more inconsistencies... I bet you at some point we'll get someone reporting how AI performance deteriorates as the code base grows, and some blog post about how their team improved the success of their AI by trimming the code base down to less than 100k LOC or something like that. The principles of good software don't suddenly vanish just because now it's a machine writing the code instead of a human, they still have to deal with the issues humans have for more than half a century. The history of programming is new developers coming up with a new paradigm, then rediscovering all the issues that the previous generation had figured out before them.
- criley2 6mo agoThe history of programming is also each generation writing far less performant code than the one before it. The history of programming is each generation bemoaning the abstractions, waste and lack of performance of the code of the next generation. It turns out that there is a tradeoff in code between velocity and quality that smart businesses consider relative to hardware cost/quality. The businesses that are outcompeting others are rarely those who have the highest quality code, but rather those that are shipping quickly at a quality level that is satisfactory for current hardware.
- neurostimulant 6mo agoJust check the leaked code yourself. Two biggest areas seem to be the `utils` module, which is a kitchen sink that covers a lot of functionality from sandboxing, git support, sessions, etc, and `components` module, which contains the react ui. You could certainly build a cli agent with much smaller codebase, with leaner ui code without react, but probably not with this truckload of functionality.
- cogman10 6mo agoThey are doing some strange "reinvent the wheel" stuff. For example, I found an implementation of a PRNG, mulberry32 [1], in one of the files. That's pretty strange considering TS and Javascript have decent PRNGs built into the language and this thing is being used as literally just a shuffle. [1] https://github.com/AprilNEA/claude-code-source/blob/main/src/buddy/companion.ts#L16 https://github.com/AprilNEA/claude-code-source/blob/main/src...
- neurostimulant 6mo agoWell, at least that confirms they weren't lying when they said all recent updates to claude code were made by claude. You certainly won't do this stuff if you were writing the code yourself.
- hombre_fatal 6mo agomulberry32 is one of the smallest seedable prngs. Math.random() is not seedable. If you search mulberry32 in the code, you'll see they use it for a deterministic random. They use your user ID to always pick the same random buddy. Just like you might use someone's user ID to always generate the same random avatar. So that's 10 lines of code accounted for. Any other examples?
- hombre_fatal 6mo agoSoftware doesn’t end at the 20k loc proof of concept though. What every developer learns during their “psh i could build that” weekendware attempt is that there is infinite polish to be had, and that their 20k loc PoC was <1% of the work. That said, doesn't TFA show you what they use their loc for?
- mpalmer 6mo agoCheck out `print.ts` to see how "more LOC" doesn't mean "more polished"
- hombre_fatal 6mo agoOkay, I'm looking at it. Now what? This file is exactly what I'm talking about. Take the loadInitialMessage function: It's encumbered with real world incremental requirements. You can see exactly the bolted-on conditionals where they added features like --teleport, --fork-session, etc. The runHeadlessStreaming function is a more extreme version of that where a bunch of incremental, lateral subsystems are wired together, not an example of superfluous loc.
- mpalmer 6mo agoThe file is more than 5000 lines of code. The main function is 3000. Code comments make reference to (and depend on guarantees in connection with) the specific behavior of code in other files. Do I need to explain why that's bad?
- hombre_fatal 6mo agoBy real-world polish, I don't mean refining the code quality but rather everything that exists in the delta between proof of concept vs real world solution with actual users. You don't have to explain why there might be better ways to write some code because the claim is about lines of code. It could be the case that perfectly organizing and abstracting the code would result in even more loc.
- 6mo ago
- gbibas 6mo ago[dead]
- forgotpwd16 6mo agoOther notable agents' LOC: Codex (Rust) ~519K, Gemini (TS) ~445K, OpenCode (TS) ~254K, Pi (TS) ~113K LOC. Pi's modular structure makes it simple to see where most of code is. Respectively core, unified API, coding agent CLI, TUI have ~3K, ~35K, ~60K, ~15K LOC. Interestingly, the just uploaded claw-code's Rust version is currently at only 28K. edit: Claude is actually (TS) 395K. So Gemini is more bloat. Codex is arguable since is written in lower-level language.
- ernst_klim 6mo agoWell FFmpeg is roughly 1500k, but it's C+Asm and it's dozens of codecs and pretty complex features. SBCL is around 500k I guess. I'm not saying that this is necessarily too much, I'm genuinely asking if this is a bloat or if it's justified.
- spiderfarmer 6mo agoI don't know if you're mindlessly repeating the HN trope that JS/typescript/Electron is bad and that all bloat can easily prevented, but if you're truly interested in answers to your questions: RTFA.
- carterschonwald 6mo agoyeah its honestly full of vibe fixes to vibe hacks with no overarching desig. . some great little empirical observations though!i think the only clever bit relative to my own designs is just tracking time since last cache ht to check ttl. idk why i hadnt thought of that, but makes perfect sense
- deleted 6mo ago[deleted]
- samusiam 6mo agoI just checked competitors' codebases: - Opencode (anomalyco/opencode) is about 670k LOC - Codex (openai/codex) is about 720k LOC - Gemini (google-gemini/gemini-cli) is about 570k LOC Claude Code's 500k LOC doesn't seem out of the ordinary.
- johnisgood 6mo agoAll of them are really, REALLY bad.
- surajrmal 6mo agoBad by whose definition? They work really well in my experience. They aren't perfect but the amount of hand holding has gone down dramatically and you can fix any glaring problems with a code review at the end. I work on a multimillion line code base which does not use any popular frameworks and it does a great job. I may be benefiting from the fact that the codebase is open source and all models have obviously been trained on it.
- oblio 6mo agoAt least Gemini and Claude constantly break down with scrolling in various Linux terminals, something which was solved by countless TUIs decades ago. I think a lot of the people prasing Claude & co are on Macs.
- johnisgood 6mo agoMost of their issues have been solved a long time ago, with 1000x less code. It is depressing at this point. I really had no clue IT was in the shitters this much. I knew it was theatrical but I had no idea that it was by this much.
- geodel 6mo agoAll these AI tools teams have most valid excuse "We are just a bunch of people who only know Javascript/typescript/NodeJS. Please bear with us while we resolve 10,000 open issues."
- ale 6mo agoThere’s probably a subconscious incentive to make a tool that’s “complex” because the underlying LLM also is complex.