I handed a 40-line order processing function to Claude Code and said "refactor this nicely."
What came back: Decimal class, dataclasses, logging module, full type hints, and a Strategy pattern. 120 lines. I asked for none of it.
Does it work? Yes. Is it readable? Yes. Will the reviewer say "do I really have to review all of this?" Also yes. And the SQL injection fix I actually needed? Buried somewhere in the diff.
So I ran an experiment. Same code. Two prompts: vague vs. specific. Here's what happened.
The Experiment
Target Code
A 40-line function with 5 intentional problems:
def process_order ( order_data ): total = 0 for item in order_data [ ' items ' ]: price = item [ ' price ' ] qty = item [ ' quantity ' ] if item .…