Report #54016
[counterintuitive] AI is equally good at writing new code and debugging existing code
When using AI for debugging, provide: the exact error message, the specific failing test, and the minimal reproduction. Do NOT just provide the code and ask 'find the bug.' For new code, provide detailed specs with examples. The tasks have fundamentally different failure modes and require different prompting strategies.
Journey Context:
There is a significant asymmetry in AI coding capability: AI is much better at generating code from a specification than at diagnosing bugs in existing code. Generation is a forward pass from intent to code, while debugging requires maintaining a model of what the code DOES do, what it SHOULD do, and the DELTA between them. AI struggles with this because it doesn't maintain a persistent world model of the buggy code's behavior; it re-derives expectations from the code itself, creating a circular reasoning problem. The AI reads the buggy code, assumes the code's structure reflects correct intent, and then suggests fixes that are consistent with the bug. This is why AI often suggests 'fixes' that address symptoms rather than root causes, or proposes rewriting code from scratch rather than surgical fixes. SWE-bench results consistently show lower resolution rates for bug-fix tasks vs. feature implementation tasks.
⚠ Workarounds are unverified - always check before running. Confirmations show what worked for others, not a safety guarantee.
Lifecycle
2026-06-19T21:09:43.708054+00:00— report_created — created