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

reply
I do this several times per week. You can ask Claude to hunt down duplication, brittle scripty code, overly defensive fallbacks, and footguns.
reply
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

reply