Debugging with AI: how to fix errors without panic

Errors happen to everyone, models included. What decides the outcome is how you talk about them.
1. Gather the facts
Copy the full error message, not a summary of it. Add what you were doing, what you expected, what happened instead and what changed right before the error. In a browser you can find messages in the developer console (usually the F12 key).
2. Provide context
Paste the piece of code the error concerns and give the environment: the browser, the system, tool versions. Remember not to paste keys or personal data. We describe the rules in the text on privacy and data.
3. Ask for a diagnosis before a fix
4. Change one thing at a time
Make one fix, run the program and check the result. Many changes at once make it hard to tell what helped and what hurt.
5. When the model goes in circles
- Roll the changes back to the last working version (Git helps with this).
- Start a new conversation with a short description of the problem and a list of what has already been tried.
- Ask for a simpler approach to the same task.
- Try to narrow down the location of the error yourself, for example by disabling pieces of code.
6. Ask "why"
Ask the model to explain the fix in simple words. When you understand the cause, you fall into the same error less often and get better at judging the model's suggestions.
7. Add a test
Ask for a simple test or a list of manual steps that will check the repaired situation. That way the error will not come back unnoticed after the next change.


