Nuhu Shaik

Free playbook

The AI Debugging Playbook

How to find and fix bugs with Claude, Codex or any AI. Stop describing the bug. Show it.

Stuck on a bug right now? Let’s work through it on a 1:1 call.

Request a call

01

Backend bugs

Logs show AI what your code actually did.

The problem

“It’s broken, fix it” makes AI guess. The guesses that seem to work often hide the bug.

You
Checkout is broken. Fix it.
AI
Added a null check and a retry. Should be fixed now!

A guess. The real bug is still there.

The fix

Remember this

Ask for logs, not a fix.

  1. Paste the exact error
  2. AI adds temporary logs
  3. Run it again
  4. AI reads them and fixes the cause

Done right

Terminalafter adding 2 logs

  1. POST /api/checkout
  2. [debug] session → expired
  3. [debug] user → undefined
  4. TypeError: Cannot read properties of undefined (reading 'id')
  5. at checkout (src/lib/checkout.ts:44:19)

The crash is on user.id. The logs show why: the session expired, so there’s no user.

Two failed fixes in a row? Start a fresh chat with what you’ve learned. A chat full of wrong attempts makes the next one worse.

Copy this prompt

Ask for logs
Something on my backend is broken. Don't fix anything yet.

How to make it happen: [what you ran or clicked]
The exact error: [paste the full error and stack trace]

Add temporary logs that start with [debug] where the data comes in, where it's loaded, and right before the line that fails. Log types and keys only: never passwords, tokens or whole user records.

Run it, show me the [debug] lines and tell me which value is wrong first. Then explain the root cause, make the smallest fix, and remove the logs.

Free playbook

Where should I send it?

The rest opens right here, and I’ll email you the link and the PDF for your computer.

  • Frontend bugs
  • Production bugs
  • The bug report builder

No spam. You’ll get the playbook now, then new guides and the occasional offer from Nuhu Ventures Inc. Unsubscribe any time. Privacy and contact details

02

Frontend bugs

A screenshot shows AI in a second what a paragraph can’t.

The problem

AI can’t see your screen, so “it looks off” could mean anything.

You
The checkout page looks off. Can you fix it?

AI has to guess what “off” means.

The fix

Remember this

Show it two pictures.

  1. 1What you seeA screenshot of the bug. If it moves or flickers, a screen recording, or a screenshot of each step.
  2. 2What you wantA screenshot of how it should look: a design you like, another app, a sketch.

Done right

Checkout

  • Linen shirtSize M$48.00
  • Canvas toteNatural$30.00
Subtotal
$78.00
Shipping
Total
$NaN
Pay now
bug.png What I see

Checkout

  • Linen shirtSize M$48.00
  • Canvas toteNatural$30.00
Subtotal
$78.00
Shipping
$6.00
Total
$84.00
Pay now
reference.png How it should look

The second picture is the best way to nail your frontend. AI matches a screenshot far better than words like “clean and modern”.

Copy these prompts

Fix from a screenshot
Image 1 is what I see. Image 2 is how it should look.
Page: [which page, and how to get there]
Look at: [the part that's wrong]

1. List every visible difference between the two images.
2. Check the console and network first. Tell me if a difference is really a data problem.
3. Fix only what causes the differences. Don't restyle anything else.
4. Open the page, take a new screenshot and compare it with image 2.

Match a design
The image I've attached is how I want [which screen] to look.
Keep my own: [logo, colours, copy]

1. Describe the reference first: layout, spacing, type, colours, corners and shadows.
2. List what's different on my screen today.
3. Change only what's needed to match. Reuse my existing components.
4. If you can open the page, screenshot it, compare it with the reference and fix what's still off.

03

Production bugs

Let your users send crash reports, and let AI read them.

The problem

Real users don’t send you stack traces. They close the app, and you never find out.

  1. Your app crashes
  2. The user closes it
  3. You never hear about it

The fix

Remember this

Ask for a crash report, right when it happens.

  • An error tracker like Sentry, or your own handler
  • A one-tap prompt after a crash. Nothing is sent without a yes
  • The reports stored in your backend
  • Your AI reading them, through MCP or an export

Done right

  1. 1 · The app asks

    Something went wrong

    Send a crash report to help fix it?

    Not nowSend report

  2. 2 · The report lands

    Crash report

    TypeError: Cannot read 'id'

    checkout.ts:42

    Steps: cart → checkout → Pay

    iPhone 15 · iOS 18 · v1.4.2

  3. 3 · AI drafts the fix

    AI

    37 reports, 4 people, one cause: expired sessions. Draft fix and test ready for review.

It’s how I run my own apps: users tap send, AI reads the reports and drafts the fixes, and I review them.

Want this in your app? I’ll show you how to set it up for your stack on a 1:1 call.

Copy this prompt

Triage crash reports
Here are the latest crash reports from my app: [paste them, or say where they are]

1. Group them by root cause, not by error message.
2. Rank the groups by how many people each one hits.
3. For the top one, show me the error, the first line in my code (file:line) and what users did just before.
4. Write a test that fails because of it, then make the smallest fix.
5. Run the tests and show me the output. Don't merge anything: I review first.

Tools

Use these when something breaks.

For any bug. Fill in what you know and copy it into your AI. Anything you skip becomes a question it asks you first.

BUG REPORT

[Clicking Pay on /checkout shows a blank page]

It knows what’s wrong.

[1. Log in]

It can make it happen.

[every time]

It knows if it’s flaky.

[the total shows $84.00 and payment goes through]

It knows what right looks like.

[a blank page and a TypeError in the console]

It can tell right from wrong.

[TypeError: Cannot read properties of undefined (reading 'id')]

It goes straight to the line.

[[debug] session → expired]

It sees the real values.

[bug.png vs reference.png, look at the total]

It sees what users see.

[merged “new session handling” yesterday]

It starts with what changed.

[production, Chrome on macOS, release 1.4.2]

It can rule out your setup.

[src/lib/checkout.ts, src/lib/session.ts]

It skips the hunt.

[a new test fails before and passes after]

It can prove the fix.

Rules: Reproduce first. Explain the root cause before editing. Don’t edit or delete existing tests. Don’t hide the error with try/catch. Keep the diff small. Show the commands you ran and their output.

Still guessing: what’s wrong, how to make it happen, how often it happens, what should happen, what happens instead, where it crashed, what changed, your setup and what fixed means.

Practice

Find the bug with logs

Tap + next to a line to log it, then press Run.

src/lib/checkout.tsNo logs yet

  1. 36export async function checkout(req: Request) {
  2. 37 const session = await getSession(req);
  3. 38 const user = await findUser(session);
  4. 39 const cart = await getCart(req);
  5. 40 const total = priceCart(cart);
  6. 41 // charge the customer
  7. 42 const id = user.id;
  8. 43 return charge(id, total);
  9. 44}
Terminal
  1. $ npm run dev · ready

Tap + next to a line to log a value after it. Then press Run.

Spot the difference

Drag to compare the screenshots, then ask the AI what’s different.

Checkout

  • Linen shirtSize M$48.00
  • Canvas toteNatural$30.00
Subtotal
$78.00
Shipping
$6.00
Total
$84.00
Pay now

What the AI sees

Drag the divider to compare them yourself. Then ask the AI to list every difference.

1:1 debugging call with Nuhu Shaik

Stuck on a bug? Let’s work through it.

We’ll trace it together, and I’ll show you how to find the next one yourself.

  • One hour, live
  • On your own project
  • CAD 200
  • Where your bug comes from, and how to fix it
  • How to set up crash reporting for your app
  • How to get your AI to debug your stack

Stuck on a bug? Request a 1:1 call at nuhushaik.com/resources/debug#call

Saves me hours every day. You help me a lot.
Gibi Saini · Media agency
3,200
monthly active users on Ayah
700
paid users on Drum Breaker
Caterpillar
web HMI for power systems
Takes a minute. I read every request myself.Not worth it? Tell me within 24 hours for a full refund.

Request a 1:1 call

I’ll reply myself within two business days.
Step 1 of 4
One call, or regular calls?