Hand It An Error
Give it more than “it broke”
Pass · ChatGPT, Pro · September 27, 2026
Pass · Claude.ai, Fable 5.1 Max · September 27, 2026
The short answer
When something breaks, “it doesn’t work” gives your AI tool nothing to go on. So it guesses, and a guess usually means rewriting things that were fine.
It needs four things from you: the whole error message, what you expected to happen, the last thing you changed, and what you have already ruled out. This prompt is a form for those four things. It also makes the tool tell you the cause before it touches anything, keep the fix small, and hand you the test that would have caught the problem.
What it does
Hands over the error, plus what you expected, what you changed, and what you already ruled out — then makes it find the cause before it touches anything.
When to use it
Every single time something breaks.
A worked example
On September 27, 2026 we ran this prompt against a small bookings page made up for the test, not a real project, with one bug planted in advance. Here is how the form was filled in (the error is shortened to its first two lines):
ERROR
Unhandled Runtime Error
TypeError: Cannot read properties of undefined (reading 'map')
WHAT WAS GOING ON
File: app/bookings/BookingList.jsx Version: Next.js 15.5.4
What I expected: the list of this week's bookings shows up.
What actually happened: the error above, as soon as the page finishes loading.
The last thing I changed: I asked the AI to tidy app/api/bookings/route.js so every API route returns the same shape.
ALREADY CHECKED, NOT IT
- The API works: in the Network tab, /api/bookings?range=week comes back 200 and I can see my bookings in the response
- The bookings table in Supabase has 6 rows for this weekThe planted cause: the tidy-up made the route return { data, error }, but the list still read json.bookings, which no longer existed, so .map had nothing to work on.
Both tools named that cause before offering a fix, changed one line, and gave a test that would have caught it. ChatGPT’s test pins the shape the route returns; Claude.ai’s feeds the list the route’s real output. Neither blamed the two things we had already ruled out. The notes for each run are in the test log below.
The prompt
ERROR
<paste the whole error message, all of it>
WHAT WAS GOING ON
File: <path> Version: <version>
What I expected: <one line>
What actually happened: <one line>
The last thing I changed: <one line>
ALREADY CHECKED, NOT IT
- <thing 1>
- <thing 2>
Tell me the real cause BEFORE you suggest a fix.
Then give me the smallest change that fixes it, and the
test that would have caught this in the first place.Ways to use it
- Keep it saved where you can paste it in one keystroke
- Always add “and the test that would have caught it”
- Ask for three possible causes, ranked, before any code
What it will not do
- It was tested on one planted bug, once on each tool, in a chat window where no code ran. That is a good sign, not a guarantee.
- It only knows what you paste. If the cause is in a file you did not share, it can only guess, so ask it to name the file it needs before it guesses.
- The test it writes proves nothing until you run it and watch it pass. In our test, nothing was run.
- If the service you depend on is down, no prompt will fix that. Check whether it is down first.
- After two fixes that don’t work, stop. Go back to the last version that worked, then ask once more in a fresh chat.
- Stuck after two fixes? Stuck in a fix loop walks through stopping, going back and asking once.
Test log
Each prompt was pasted into a fresh private chat with memory off and graded against pass standards written before the run (all of them, dated).
| Date | Tool | Model | Result | What happened |
|---|---|---|---|---|
| September 27, 2026 | ChatGPT | Pro | Pass | Named the cause (route now returns data, list reads bookings) before the fix, changed one line, and gave a contract test on the response shape. |
| September 27, 2026 | Claude.ai | Fable 5.1 Max | Pass | Named the renamed response key as the cause first, changed one line, and gave a test that feeds the component the real route's output. |
The pass standard for this prompt: five criteria and an automatic-fail rule, written down on September 27, 2026, before any run.
Related words
- rubber duck debugging — Explaining your problem out loud, line by line, to something that cannot answer, until you spot the mistake yourself.
- hallucination — When an AI confidently makes something up: a command, a quote, a setting, a fact that does not exist.
- confident wrongness — An answer that reads well, looks tidy, sounds certain, and is wrong.
Where to go next
- Stuck in a fix loop — when two fixes in a row have not worked
- Cannot read properties of undefined — the error from the example, explained
- Errors, explained — eight common errors, what they mean and how to check the fix
- Hunt Regressions — once it is fixed, make it look for what else the fix broke
- Is it down? — one live page per AI and hosting service