Beginner12 min readBadge: Bug Hunter

Debugging with AI: when it breaks

Read the error, reproduce it, give the AI the right clues, and undo safely. The skill that separates finishing from giving up.

Everything breaks. That's normal.

Every builder, beginner or senior, spends a big part of their time fixing things. Vibe coding doesn't remove bugs; it makes them faster to fix, if you hand the AI good evidence instead of 'it doesn't work'.

Debugging is detective work: find out exactly what happens, compare it to what should happen, then narrow down where the difference starts.

Step 1: Reproduce it

Write down the exact steps that cause the problem: 'Sign in as a new user, click Save on an empty form, the page goes blank.' If you can make it happen on purpose, you can prove it's fixed. If it only happens sometimes, note what's different when it does (phone vs laptop, signed in vs out, first visit vs later).

Step 2: Find the error message

The computer usually tells you what went wrong; it just whispers. Look in these places:

  • On the page: red text, a toast, or a blank screen with a message.
  • The browser console: right-click, Inspect, then the Console tab. Red lines are errors.
  • The Network tab: a failed request shows a status like 401 (not signed in), 403 (not allowed), 404 (not found) or 500 (server error).
  • Build logs and runtime logs on your host (Vercel, your builder's log panel).
  • Your database dashboard's logs (Supabase has logs for the API, auth and database).

Step 3: Brief the AI like a detective

A great debugging prompt has five parts:

  • What you did (the reproduce steps).
  • What you expected to happen.
  • What actually happened.
  • The exact error text, copied, not paraphrased, plus where you found it.
  • What changed recently ('it worked before I added the photo upload').

Step 4: Fix small, test, and keep an exit

Ask the AI to explain the cause before it changes anything, then to make the smallest fix. Test your reproduce steps again. If a fix makes things worse, don't stack fixes on fixes: go back to your last working version (a Git commit or your builder's history) and try a different approach.

Stuck in a loop where the AI keeps 'fixing' and nothing changes? Start a fresh chat with a short summary and the exact error, or ask it to add logging so you both can see what's really happening.

Key terms

Bug
A mistake that makes software behave wrongly.
Debugging
Finding and fixing bugs, often by reading the exact error message.
Error message
The computer's description of what went wrong. Copy it exactly when asking for help.
Browser console
The developer-tools panel (Inspect, then Console) that shows a page's errors and logs.
HTTP status code
A number a server sends back: 200 OK, 401 not signed in, 403 not allowed, 404 not found, 500 server error.
Reproduce (a bug)
Make a bug happen on purpose with exact steps, so you can prove a fix works.
Logs
Records of what happened during a build or while the app ran, including errors.
Revert
Undo a change by going back to an earlier working version, often a Git commit.
See the full glossary

Try it

Break it on purpose

  1. In any small project, ask the AI to deliberately introduce one bug and not tell you where.
  2. Reproduce it, find the error in the console or logs, and write a five-part debugging prompt.
  3. Fix it with the AI, then confirm your reproduce steps now pass.
  4. Commit the working version with a clear message.

Ask an AI tutor about this guide

Copy a prompt into ChatGPT, Claude or Gemini to go deeper. Check what it tells you against the guide.

Study with an AI tutor: copy this whole guide with tutoring instructions, then paste it into your AI assistant.
  • Explain it like I'm 12
  • Quiz me (5 questions, one at a time)
  • Show me a real example for my situation
  • What do beginners get wrong?

Knowledge check

Five questions. Get 4 right to earn the Bug Hunter badge. You can retake it as often as you like.

Question 1 of 5

What's the most useful thing to give an AI when asking it to fix a bug?

Finished the Vibe coding guides? Take the Vibe coding track test for ten mixed questions.

My notes

Write what clicked, what confused you, and what you want to try. Saved in this browser only.

Learn it live

Digital Builders University runs small live workshops where you build something real with an instructor beside you, starting with Vibe Coding 101.

See workshops

Practise it

Last reviewed November 25, 2026. AI tools change fast; check each tool’s own site for current features, plans and prices.