Debug a prompt that worked yesterday and does not today
A diagnostic order that finds the cause in minutes instead of an afternoon of rewriting.
Before you start
- A prompt that used to work reliably
- An example of the bad output
What you will be able to do
- Separate a model change from a prompt problem from an input problem
- Reproduce a failure deliberately instead of waiting for it
- Fix the actual cause rather than the nearest symptom
A prompt that has worked for weeks suddenly produces something off. The reflex is to start editing, and the reflex is wrong — you will change five things, one of which fixes it, and learn nothing.
Work through these in order instead. The cause is usually found in the first two.
Check the input before the prompt
Nine times in ten the prompt is fine and today's input is different.
Diff today's input against one that worked. Longer? Different formatting? Pasted from somewhere new and carrying invisible markup? Missing a section it always had?
Prompts are far more sensitive to input shape than to input content, and "it is the same as always" is very often not true when you look.
Rule out the conversation
Fresh chat, same prompt, same input. This one test splits the problem in half.
Run it in a completely new conversation. If it works there, nothing is wrong with the prompt — something earlier in the old thread is steering it, which is common in long sessions and after a correction that the model is still honouring.
If it fails there too, you have a real reproduction and can start bisecting.
- Keep one known-good input saved specifically as a regression test. Diagnosing without a baseline is guesswork.
Check whether the model moved
Providers update the model behind the same name, usually without telling you.
If a fresh chat still fails and the input is unchanged, the model itself may have been updated underneath the name you are calling. This is normal and it is why pinned versions exist in the APIs.
The tell is a change in register rather than correctness — output that is suddenly more verbose, more hedged, or more formatted than it was. Nothing you write will undo an update; you re-tune to the new behaviour.
Bisect the prompt, do not rewrite it
Cut it in half. Find the half that carries the failure. Repeat.
With a reliable reproduction, delete half the prompt and run it again. Keep the half that still fails and halve again. Four or five rounds isolates the instruction responsible.
What usually surfaces is two instructions that quietly contradict each other — a length limit against a completeness demand, say — which had been resolved one way and is now resolved the other. That is a fix you can make once and explain.
- Rewriting the whole prompt and declaring victory. It will fail again and you will still not know why.
Isolate before you edit. A prompt you rewrote without knowing what broke is a prompt that will break again in a way you still cannot diagnose.
Common questions
Was this guide useful?
95% of readers found this useful
Read next
Write a reusable prompt template your whole team can use
A prompt that only works in your hands is a prompt with your context silently baked in. Making it portable is a specific and learn…
Prompt engineering basics that actually change the output
Most prompt advice is folklore. These five techniques reliably change what a model produces, and it is worth knowing which popular…
Write tests first and let AI fill in the implementation
The hardest part of using AI for code is knowing whether the result is right. A test written before the code answers that question…
Build your first agent that does one thing reliably
Agent demos look magical and agent deployments mostly fail on the same three things: unbounded loops, unverified tool output, and…