Debugging with AI: how to fix errors without panic

Practice6 min read

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

Explain what might be causing this error. Give 2-3 hypotheses and say how to check them. Do not change anything in the code for now.

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

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.