- Home
- Skills
- Testing & Debugging
- Regression Bisect: Find the Commit That Broke It
Works with the AI Agents you already use
Regression Bisect: Find the Commit That Broke It
**The problem.** "It used to work" is one of the most common bug reports, and `git bisect` can answer it in a dozen steps.
$9
Regression Bisect: Find the Commit That Broke It
Example session with this skill installed
Our CSV export started dropping the last row sometime in the last two months. v3.8.0 was fine. Find the commit that broke it.
- Read your context and instructions
- Compiled the regression bisect
- Generated the data export
Example session (illustrative).
Starting state recorded: branch main at 4e1c9d2, working tree has 2 uncommitted files, so bisecting in a separate worktree at ../bisect-wt.
Endpoints verified:
- bad =
main(4e1c9d2): script exits 1, export has 99 of 100 rows. - good =
v3.8.0(a07b3f1): script exits 0, 100 of 100 rows. - 412 commits in range, about 9 steps.
Reproduction script (/tmp/repro-export.sh, outside the repo):
pnpm install --frozen-lockfile || exit 125,pnpm build || exit 125- runs the exporter on a fixed 100-row fixture with
TZ=UTC, undertimeout 60(124 mapped to 125) - counts data rows: exactly 100 exits 0, anything else exits 1
Run: git bisect start main v3.8.0 then git bisect run /tmp/repro-export.sh. 10 commits tested, 1 skipped (lockfile referenced a yanked package version, exit 125).
Culprit: 9b52e07 perf(export): stream rows in chunks of 500 (merged in PR #1184).
- Confirmed: culprit exits 1, parent
9b52e07^exits 0,git revert --no-commit 9b52e07onmainrestores 100 rows. - Diff summary:
src/export/csv.ts | 41 +++++---,src/export/chunk.ts | 18 +++. - Why it broke: the new chunk loop computes each chunk as
rows.slice(start, end - 1); the- 1was meant for an exclusive index thatslicealready treats as exclusive, so the last row of every chunk is dropped. With 100 rows there is one chunk, so exactly one row disappears. - Proposed fix:
rows.slice(start, end); regression test exporting 1, 499, 500 and 501 rows and asserting the row count.
Cleanup: git bisect log saved to /tmp/bisect.log, git bisect reset, worktree removed. main is still at 4e1c9d2 with your 2 uncommitted files untouched. No commits were made.
regression-bisect-find-the-commit-that-b.csv
CSV · data export
Example file from a real run - the skill writes it into your workspace.
Connects securely to your tools. The creator never sees your data.
About this skill
The problem. "It used to work" is one of the most common bug reports, and git bisect can answer it in a dozen steps. Agents rarely get it right on their own. They write a reproduction script that exits 127 because a tool is missing on old commits (git counts that as "bad"), treat build failures as bugs, let a segfault (exit 139) abort the whole run, trust a single pass of a flaky test, install today's dependencies on a two-year-old commit, or forget git bisect reset and leave the repository on a detached HEAD in the middle of nowhere.
What the agent does with this skill.
- Records the starting branch and HEAD, and bisects in a throwaway
git worktreeso your checkout and uncommitted changes are never touched. - Picks and verifies good/bad endpoints before starting, using tags, CI history or exponential probing.
- Writes a deterministic reproduction script outside the repo with the exit codes
git bisect runactually understands: 0 good, 1-127 bad except 125 skip, 128+ aborts. It handles the traps: 126/127 from missing commands, 124 fromtimeout, crash signals, unbuildable commits. - Reinstalls from each commit's own lockfile (
npm ci,pnpm install --frozen-lockfile,cargo build --locked) and skips commits that cannot be installed. - Uses
--first-parentto find the merge or PR in merge-heavy histories, then bisects inside it. - Uses
--term-old/--term-newto find when something got faster, slower or changed, not just when it broke. - Handles flaky bugs by repeating the check N times, with N computed from the measured failure rate.
- Confirms the culprit (culprit fails, parent passes, revert fixes it) and reports: commit, diff summary, why it broke, evidence, proposed fix and regression test.
- Always ends with
git bisect reset, never commits during a bisect, and leaves the working tree as it found it.
Who it's for. Developers who hand debugging to Claude Code, Cursor, Codex CLI or similar agents, on any git repository and any language.
Requirements. Any agent that supports SKILL.md skills and can run shell commands. git 2.29+ for --first-parent (everything else works on older git). Works with or without AgentHarness.
Find more skills like this on the Claude Skills Marketplace, the Codex Skills Marketplace and the Gemini Skills Marketplace, or browse Claude Skills for Testing & Debugging.
Requires deterministic reproduction. Long build times will slow execution. Not suitable for bugs that only manifest in production environments with external state.
How to use
- 1
Connect your agent to the Agensi MCP
Copy the prompt and paste it into Claude, ChatGPT, Cursor or any agent that supports MCP. It sets up the connection for you. Manual setup
- 2
Sign in to Agensi
Your agent shows a sign-in link. Sign in and click Allow.
- 3
Ask for what you need
Your agent loads this skill and uses it on your task. It always asks before buying a skill.
Reviews
No reviews yet
Be one of the first to try it. Every listed skill goes through the trust checks below.
Security scanned
Checked by our 8-point scan before listing
Fresh listing
Recently published to Agensi
Money-back guarantee
Doesn't do what its page promises? You get your money back.
Trust & safety
Security scan
Security scan passed 17 days ago
- Software
GitA command that reproduces the bug
Python