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.