Hacker News new | ask | show | jobs
by cmiles74 4 days ago
I’ve been using Claude Code with Opus 4.7; it’s not that the code it produces is wrong, it simply tends to write too much of it. In my opinion it’s still worth thinking about a particular feature and finding the best way to fit it into your code because Claude will often just pick a layer of the stack (maybe presentation), and jam it in there. A couple weeks later you need this data somewhere else and Claude can’t reuse the code (maybe in the service layer) so it kind of “ports” it over. Unless a person is paying attention we now have the double the amount of code and duplicate logic. I don’t see AI tools like Claude getting better at this anytime soon.

Where I work there’s already pressure to use Opus 4.7 less to save money, someone mentioned using a smaller model for “simple bug fixes”. This might work sometimes but how often do we really know it’s a simple bug fixe ahead of time? I suspect as costs go up we’ll see interest in using these tools to write “all the code” go down. As people migrate to cheaper and less effective models I suspect we’ll see the pressure to skip reviewing that code dissipate as well.

We’ll see where we land, maybe it won’t as dramatically different as the author of this post fears.

3 comments

I have the same criticism of AI writing too much code. It's surprisingly effective to just tell the AI to cut the (prod) line count in half and look at whether there are other libraries it could reuse. I think you could probably also have a refactor bot that spots duplication and pulls it out.

None of this comes out of the box atm, but it's not clear that it's not possible.

I do this several times per week. You can ask Claude to hunt down duplication, brittle scripty code, overly defensive fallbacks, and footguns.
It's kind of dumb that we have to do this as a separate process, which introduces even more churn and review burden, rather than having this out of the box in the code generation process.
But think of the profits for the AI companies!
I had a scenario the other day where the codebase had two functions

fooBar() and fooBarExtended()

The latter had additional params and functionality that was needed for the current problem.

Instead of calling that function though Claude kept trying to add in the same extended params to the first function

Even after telling it not to do that it kept suggesting the same thing again later, its so annoying sometimes

I have also noticed the too much code issue.

The open question for me is whether too much code is actually a problem.

These tools are a fact of life now. If we can solve problems or debug faster, and the software is less buggy, than it's not too much lines of code, it's just right.

I hear what you’re saying, I’ve wondered this myself. My suspicion is that if we let duplicate or very similar code accumulate, eventually we’ll have enough that it will start to slow down or impact the success rate of the AI tooling. It might update two chunks of relevant code but miss the third, leading to a bug. Or it might grow confused over which of three similar chunks of code are providing the “correct” behavior.
Meanwhile most of the software I use seems to become less reliable every month.
Too much code means more complexity for humans and LLMs to comprehend. More complexity means harder to change and more prone to bugs.

This is not just right, no matter on which side of the argument you are.