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.
Try it
Break it on purpose
- In any small project, ask the AI to deliberately introduce one bug and not tell you where.
- Reproduce it, find the error in the console or logs, and write a five-part debugging prompt.
- Fix it with the AI, then confirm your reproduce steps now pass.
- 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.
- 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
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 workshopsPractise it
- Build Challenge: Habit tracker with streaks (Builder, 3 hours)
- Game: Error Detective (read real error messages and pick the fix)
- Code playground: Fix the off-by-one bug (edit and run it in your browser)
- Code playground: Escape the infinite loop (edit and run it in your browser)
- Cheat sheet: Debugging checklist
- Game: Bug Hunt (read short code snippets and find the bug)
- Game: Prompt Fixer (pick the prompt that gets the best result)
Official sites
- Chrome DevTools: Console overview (opens in a new tab)
- MDN: HTTP response status codes (opens in a new tab)
Last reviewed November 25, 2026. AI tools change fast; check each tool’s own site for current features, plans and prices.
