differential-debugging-and-bisectionlisted
Install: claude install-skill BenMacDeezy/Orns-Forge
# Differential debugging and bisection
`superpowers:systematic-debugging` covers the general hypothesis loop for a
bug you can already see and reproduce. This skill covers the gaps: bugs
defined by a *change over time* (regressions), a *change over space*
(works-here-fails-there), or a *change over runs* (nondeterminism). Load
this alongside systematic-debugging, not instead of it — use it to locate
the cause, then hand off to that skill's hypothesis loop to fix it.
## 1. Regression → git bisect first
If the bug is "this used to work," don't hypothesize from the current
diff — bisect finds the actual causal commit in O(log n).
1. Confirm you have a known-good ref and a known-bad ref (a tag, an old
commit, `HEAD`).
2. `git bisect start`, `git bisect bad <bad-ref>`, `git bisect good <good-ref>`.
3. If the repro is scriptable (exit 0 = good, non-zero = bad, 125 = skip
this commit — e.g. it doesn't build), automate it:
`git bisect run <script>`. Writing that script IS the minimal-repro step
(§3) — do it before bisecting, not after.
4. `git bisect view` / the final output names the first-bad commit.
`git bisect log` captures the trail for the eventual root-cause writeup.
Always `git bisect reset` when done, even on failure paths.
5. The first-bad commit is a strong causal hypothesis, not a proven root
cause — read its diff, then verify with systematic-debugging's evidence
loop rather than assuming the commit message explains the bug.
## 2. Differential