Skip to main content
All AI tricks
Quick trickDevelopmentIntermediate

Stop the AI Fix Loop: Reset With a Minimal Reproduction

After two failed AI fixes, stop patching. Write expected versus actual, shrink the bug to the smallest example and ask for ranked hypotheses with a test for each.

10 min practicePlatform independentUpdated · Last checked Oct 24, 2026
Jump to the lesson ↓
Abstract illustration of a circular arrow that breaks into a straight path, in the colours of the Development topic.
Original conceptual illustration made for this lesson. Not a screenshot, product test or endorsement.

The useful result

Turn a stubborn bug into a minimal reproduction and a ranked list of testable causes.

  • Turn a stubborn bug into a minimal reproduction and a ranked list of testable causes.

Fix, run, new error, paste, fix, run. By the fifth round the code has grown, the original bug is buried and the assistant is patching its own patches. This is the classic debug loop with AI, and more prompting rarely ends it.

What ends it is a smaller problem. A minimal reproduction is the smallest piece of code that still shows the bug. Making one forces you to understand the fault, and it gives the assistant a clean target. Then ask for hypotheses with tests rather than another fix.

The examples below are illustrative exercises, not recorded results from any tool. Sources were checked on 24 October 2026; menus, limits and prices change, so confirm details on the linked pages.

Before you start

  • A bug that two AI fixes did not solve
  • The exact error message or wrong output
  • A scratch file or folder where you can experiment

Review evidence

Documentation-based review · 2026-10-24

Primary documentation and official guidance checked on 24 October 2026. Examples, checks and exercises are original illustrations, not recorded tool tests. Cover artwork is a conceptual illustration.

1

State expected versus actual, in one sentence each

Write what should happen, what actually happens, the exact error text and what you changed last. If you cannot state the expected result precisely, the problem is not yet a bug report. Stop asking for fixes until you can.

Check your result

You have expected, actual, the exact error text and the last change written down.

2

Shrink the code until the bug is still there

Copy the project to a scratch folder and remove code in halves: delete half, check if the bug remains, and repeat. Keep going until removing anything more makes the bug disappear. What is left is your minimal reproduction, often under twenty lines.

Check your result

A small example, runnable on its own, still shows the same error.

3

Ask for ranked hypotheses with a test, not a fix

Give the assistant only the minimal reproduction and the expected-versus-actual statement. Ask for three possible causes ranked by likelihood, each with a quick test that would confirm or rule it out. Run the cheapest test first, then ask for a fix based on the confirmed cause.

Try this prompt
Here is a minimal reproduction and what I expect versus what happens: [paste]. Do not write a fix yet. Give three possible causes ranked by likelihood. For each, give one quick test I can run to confirm or rule it out, and what result I should see in each case.

Example / expected result

Illustrative example; not a recorded model result.

“Cause 1 (likely): the date is parsed as local time. Test: print the raw value before parsing. If it shows ‘T00:00:00Z’, this is the cause.”

Check your result

You have run at least one test, and you can say which hypothesis it confirmed or ruled out.

When it goes wrong

Do not paste secrets or customer data into the reproduction. Some bugs depend on timing or data size, so a tiny example may hide them; note that in your report. Keep the original copy intact while you shrink the scratch version.

Make it your own

Take a bug from your own project, shrink it to under thirty lines and write the three-sentence report. Record how long the process took compared with your last fix loop.

Useful next resources

Sources and review

Last checked Oct 24, 2026. Features and account limits can change. Verify important results against your original material.

Did this help you complete your task?

Tell us what needs improving. No account or private output required.

Was this useful?
Report incorrect information or a broken link

Genius Forges Editorial

Practical AI lessons with checked sources, labelled examples and human verification.

Keep building your AI habits

Keep learning useful AI tricks

Get practical lessons and resources when we publish them.

Turn this idea into a daily skill

Practice with a small input and check the result before sharing.

We use optional cookies for analytics and referral tracking. Learn more about our privacy policy