Debugging With AI
Every program you build will break. That is not a sign you are doing it wrong — it is the normal state of software. Bugs are not a failure of skill; they are what happens when real code meets real data, real users, and real cases nobody imagined. The difference between a frustrating afternoon and a five-minute fix is method. When you debug by vibe coding, you are not the one staring at the stack trace until it makes sense — the stack trace being the error report your program prints when it crashes, which we'll unpack later. You are the director: you reproduce the problem, gather the right evidence, and hand the AI a tight, well-framed case so it can do the heavy lifting. This chapter gives you a repeatable process for exactly that — one that works whether the bug is a one-line typo or a tangled race condition three layers deep. (A race condition is a timing bug: two things happen in an order you didn't expect, like two people grabbing the last seat at once.)
