Lesson 179 · 2 min

Fixing bugs with AI

To get good help with a bug, show the AI what you expected, what actually happened, the exact error and the steps to repeat it.

"It doesn't work" is the hardest bug report to fix, for people and for AI. The AI will guess, change several things at once, and often create a new problem.

Give it four things. What you did, step by step. What you expected to happen. What happened instead. And the exact error message, copied in full, or a screenshot. If you know when it started, say so.

Ask the AI to explain the likely cause before it changes anything, and to make one change at a time. Test after each change. If the same fix fails twice, ask it to list other possible causes instead of trying the same idea again.

Keep a working copy before you start, so you can go back. When a fix works, ask for a one-line note of what was wrong. Over time those notes become your own troubleshooting guide.

Do it now

Write a four-part bug report

  1. 1. Think of something that went wrong recently, in an app, a spreadsheet or a tool you built.
  2. 2. Fill in the four parts in the prompt below.
  3. 3. Notice how much more focused the AI's answer is than a vague question.
I have a problem.
What I did: [STEPS]
What I expected: [EXPECTED]
What happened: [ACTUAL]
Error message: [PASTE EXACTLY]
Explain the most likely cause first, then suggest one fix at a time, starting with the safest.

Quick check

An AI's fix has failed twice. What is the best next request?

An AI's fix has failed twice. What is the best next request?

More on this

Words from this lesson

Vibe coding
Building software by describing what you want to an AI and accepting its code, often without reading it closely.
Hallucination
When an AI states something false with confidence, such as a made-up fact, quote or source.
Prompt chaining
Breaking a big job into a sequence of smaller prompts, feeding each answer into the next step.