How Do You Stop ChatGPT From Guessing at Bug Fixes?
Tell it not to fix anything yet. Ask for the likely causes, ranked, plus a quick check that would prove or rule out each one. Only ask for the fix once a check has confirmed the cause. In Codex, /plan gives you this order by default.
Don't fix anything yet. I want to understand this bug first. Symptom: [what happens, and when] Evidence: [error, logs or failing test] Code: [paste it, or name the files] What I've already tried: [attempts and their results] Give me up to three possible causes, most likely first. For each: 1. What in the code or evidence points to it 2. One quick check that would confirm or rule it out, such as a log line or a small test 3. What result I'd see if it's the cause Then stop. I'll run the checks and tell you what I find. Say clearly if you're unsure, or if the evidence doesn't support any of these.
- 1The symptom
- 2Likely causes
- 3A check that tells them apart
- 4Then the fix
Try it now
- 1Send the prompt with a bug you've been putting off. In Codex, enter
/planfirst, or use/permissionsto set it to read-only. - 2Run the quickest check it suggests, and paste the real result back.
- 3Ask for the fix only when one cause is confirmed. It worked if the fix explains why the other candidates were wrong, and your original failure is gone.
Use it when
Intermittent bugs, wrong results with no error, anything in production, and any time you've already tried one fix that didn't hold. If the fix would touch shared code, you'll want the reason first.
Skip it when
An obvious typo or a clear message like a missing import. The cause is already on the screen, so asking for three theories just wastes a turn. Go straight to "fix this" and run the code.
Why it works
A fix can make the symptom go away while leaving the cause in place. Asking for the cause first forces a claim you can test. OpenAI's Working with agents page explains why that's needed: fluent writing or a confident summary doesn't prove success, so check that important claims are supported.
Codex has modes for this. OpenAI's Prompting guide says /plan lets Codex "investigate and propose an approach before editing." The read-only preset lets it inspect files, and it can't change them. Its Models page suggests High or Extra High effort for difficult multi-step work, with multiple sources or tradeoffs, and the Model selection page lists GPT-6.1 Sol at Extra high for decisions based on conflicting evidence.
If you're on a plan with those reasoning models, a hard bug is a good place to use them.
Example
A checkout total is off by a cent on about 1 in 200 orders. Asked for a fix, ChatGPT might just round the final figure and hide the problem. Asked for causes, it might offer floating-point math on prices, rounding per line versus per order, or a discount applied in two places. Logging the raw values for one bad order takes minutes and tells you which it is. The fix then targets that cause.
Going further
Keep going while Codex works. OpenAI's guide says Steer adds a message to the current run, to change direction or share new information, and Queue saves it for the next run. So when your log check comes back, steer with the result. For a question that would derail the thread, /side starts a temporary side chat without interrupting. And separate the review from the fix: /review reads the diff and reports prioritized findings without changing your working tree. Giving reviews their own model through review_model means a second opinion can come from a different setting.
Common mistakes
- Accepting a confident cause with no evidence. Ask what in the code or logs points to it.
- Asking for a cause and a fix in the same message. The fix tends to anchor everything, and you'll stop checking.
- Reporting a check result from memory. Paste the real output.
- Keeping a fix that made the symptom vanish when you can't say why. Bugs fixed by accident tend to come back.
Sources
- ChatGPT Learn: Working with agents
- ChatGPT Learn: Prompting
- ChatGPT Learn: Models
- ChatGPT Learn: Model selection
- ChatGPT Learn: Agent approvals and security
- ChatGPT Learn: Slash commands
- ChatGPT Learn: Code review
Checked 6 November 2026. Products change often, so confirm details with the vendor.