Reproduce before you prompt

“Fix my app” is not a useful debugging request. Write a minimal reproduction: the input, expected behavior, actual behavior, environment and exact error message. Record the version and recent changes. Remove secrets from logs before sharing them with any assistant. If the bug is intermittent, collect several examples and note what they have in common. A model that never sees the failure condition can only guess.

Ask the assistant for two or three hypotheses and the evidence that would distinguish them. It might suggest a parsing error, a race condition or an incorrect assumption about a dependency. Pick one test that can falsify each hypothesis. This keeps the process anchored in observation instead of accepting the first plausible explanation. If the assistant proposes changing many files at once, ask for the smallest patch and a reason for every changed line.

Review the patch as a maintainer

Run the existing tests, then add a regression test that fails before the fix and passes after it. Check edge cases and unintended behavior in adjacent routes. Read the diff. An AI-generated solution can silence an error by catching and ignoring it, or make the happy path work while weakening validation. Do not let a coding agent push to production with broad credentials merely because its explanation sounds confident.

When the fix touches external APIs or libraries, verify current documentation. A model may remember an older method or invent an option. Measure performance if the change affects a hot path. Ask whether the patch changes security boundaries, data formats or migrations.

Close the loop

Write a short incident note: root cause, evidence, fix, test and what would have caught it sooner. If you cannot explain why the patch works, you have not finished debugging. AI is valuable at exploring hypotheses and drafting tests, especially in unfamiliar code, but it is not a substitute for a reproducible failure and a human-reviewed change. The goal is a smaller search space and a safer fix, not the fastest green checkmark.