🤖 The AI Prompt That Finds Which Commit Actually Caused a Regression
Bisecting a regression by hand means checking out one commit at a time and judging each one ‘good’ or ‘bad’ – a well-specified, repetitive task a model can help structure before you spend time running anything, not by replacing git bisect but by narrowing which commits in a long range are even plausible suspects. Given the full range of diffs and the exact symptom up front, a model can rank candidates by whether their actual changed lines could plausibly produce that specific symptom, which is a much smaller list to test by hand than the full range.
🔎 The Problem
PROMPT: "Here is a regression: [describe the exact symptom and when it started being observed]. Here are the diffs for every commit between the last known-good version and the first known-bad version [paste git log -p or equivalent]. Rank these commits by how plausible each one is as the cause, and for your top 3, state EXACTLY which lines you think are responsible and why, in terms of the reported symptom. Do not just describe what each commit does in general."
✅ The Fix
- Ranking plausibility instead of naming one definitive cause keeps the output honest about uncertainty, giving you a short, ordered list to actually test instead of one unverified guess to accept on faith.
- Requiring specific lines tied to the specific symptom forces a check against the commit’s real diff, instead of a generic-sounding explanation of what a commit ‘probably’ does to the codebase in general.
- Confirm the top candidate with an actual git bisect run (or by reverting just that commit) as the real verification step – the prompt narrows the search, it never replaces testing whether the answer is actually right.
🚨 Why This Is Dangerous
Trusting a single confidently-named ‘this commit caused it’ answer without checking its real diff risks reverting or blaming the wrong change entirely, especially in a long commit range where several unrelated changes plausibly touch the same area of code.
A long commit range isn’t one mystery, it’s a list of suspects – rank them by what they’d actually have to do to cause your specific symptom before you test any of them.




