Get systematic, step-by-step debugging help for any code snippet.
Why it works: Stating expected vs. actual behavior forces a real bug report, and asking what you've tried stops the model from suggesting things you've already ruled out.
This is a message template. Fill in the blanks below, then paste it into the chat.
I have the following code that isn’t behaving as expected. Please help me debug it systematically.
Code:
[paste code here]
What I expected: [describe expected behavior]
What actually happens: [describe actual behavior, include error messages if any]
What I’ve already tried: [list any debugging steps you’ve taken]
Please:
Identify the most likely root cause(s)
Explain why the bug occurs
Suggest a fix with corrected code
Point out any related issues you notice that I should be aware of