Debugging without guessing
A method that works even when you don't understand the code.
The default debugging loop for vibe coding is: paste the error, apply the suggested fix, get a new error, repeat. Sometimes that works. When it doesn't, you end up with three speculative changes layered on top of each other and a bug you now understand less than when you started.
Rule one: change one thing
Before anything else, make sure you can get back. Commit. Then apply exactly one change at a time and check the result. Two changes at once and a working app tells you nothing about which one mattered.
Rule two: reproduce it reliably
A bug you cannot trigger on demand cannot be fixed, only guessed at. Write down the exact steps that produce it. If it happens "sometimes", find what differs between the times it does and doesn't — a different input, an empty list, a slow network, a second click.
Rule three: find where, before you ask why
The instinct is to ask "why is this wrong?". The productive question is "where does it stop being right?". Data starts correct and ends wrong; somewhere between those points is a specific line.
Something goes wrong between <the input> and <the wrong output>. I don't know where. Don't suggest a fix yet. Give me a sequence of checks that each split the remaining path roughly in half — logging or printing at chosen points. For each: exactly what to add, and what each possible result would tell me.
Ten halvings narrow a thousand lines to one. Guessing does not narrow anything.
Rule four: make it demand a root cause
Models are agreeable. Asked to fix something, they will produce a fix, whether or not they know the cause. Force the diagnosis to come first:
Before suggesting any fix, tell me in one sentence what you believe the root cause is, and how confident you are. If you are guessing, say "I am guessing" and tell me the single check that would confirm or eliminate it.
"I am guessing" is a genuinely useful answer, and you will only get it if you make it an acceptable one.
Rule five: understand the fix before you keep it
A fix you do not understand is a bug waiting to come back somewhere else. Ask what it changed and why that solves it. If the answer is vague, the fix probably covers a symptom.
When you are properly stuck
Start a new chat. Long debugging sessions accumulate wrong theories, and the model has been reading all of them and agreeing with you. A fresh context with the bug described cleanly finds things the eighty-message thread cannot. See why context is everything.