Prompt Engineering Walkthrough Advanced Updated

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.

2 min read 19 min to complete 4 steps Last updated 9 Aug 2026

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

4 min

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

3 min

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.

Tips
  • Keep one known-good input saved specifically as a regression test. Diagnosing without a baseline is guesswork.

Check whether the model moved

4 min

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

8 min

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.

Watch out for
  • 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

It reduces variation between runs but does not fix a prompt that is ambiguous. If two runs disagree about what you asked for, the instruction is unclear and the temperature is hiding it rather than solving it.

Was this guide useful?

95% of readers found this useful

S

Sabir Verified

Founder & AI Enthusiast · AIToolsay

Founder of AIToolsay and a passionate AI enthusiast dedicated to building practical, user-friendly AI tools that simplify everyday tasks.

Read next