Thuta Learning
IntermediateAIbeginner

How to Debug with AI

Relax. We'll talk through this in plain words — no textbook voice.

What you'll walk away with

  • Understand how to debug with AI without the fear factor
  • Get hands-on and try it yourself
  • Learn to spot (and smile past) the common mistakes

Give AI the error message, reproduction steps, and the 'don't touch this' boundaries — and use it as an assistant, not a teacher.

Let's think about it this way for a sec

A good debug prompt makes AI's search fast. A bad one gets you edits to files that have nothing to do with the bug. You need to own the story: which button you clicked, what you saw, what showed up in the console. Before you tell AI to 'fix it,' ask it to 'tell me which function you suspect first.' That way you actually learn something too.

Connecting it to everyday life

Copy the full stack trace. If you're seeing 'Cannot read properties of undefined (reading map),' first ask which array is likely undefined. Have AI explain the root cause before asking for a fix. Once it's fixed, try to reproduce the bug again — only close it out once it stays gone.

Let's try it together

text
Bug report for AI
1. Open /mm/notes
2. Click Add with empty input
3. Actual: page crashes
4. Expected: inline “title required”
5. Console: TypeError notes.map is not a function
6. Do not change create UI. Inspect loadNotes() first.
You should see
You'll be able to use AI as a debugging assistant while understanding the root cause yourself.

5-Minute Try-It

Write a bug report for a current bug, following the format above. Ask AI for the root cause before asking for a fix.

A Quick Word of Caution

Never treat AI output as automatically correct. Have a human read through the code and test it — and double-check secrets and user data — before you rely on it.

Easy traps

  • Sending just a bare error screenshot without explaining what you did
  • Accepting a fix that touches 10 files without reading through it

Now Try It Yourself

Write a bug report for a current bug, following the format above. Ask AI for the root cause before asking for a fix.

You'll know it worked when: You'll be able to use AI as a debugging assistant while understanding the root cause yourself.

How to Debug with AI | Thuta Learning