Works with the AI Agents you already use

    Claude CodeClaude CodeCursorCursorCodex CLICodex CLIMuseMuseDotsDots+21 more

    Regression Bisect: Find the Commit That Broke It

    1

    **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

    Secure checkout via Stripe

    Money-back guarantee

    Converts to your local currency at checkout

    Security scanned
    Regression Bisect: Find the Commit That Broke It

    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, under timeout 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 9b52e07 on main restores 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 - 1 was meant for an exclusive index that slice already 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

    Generated

    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 worktree so 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 run actually understands: 0 good, 1-127 bad except 125 skip, 128+ aborts. It handles the traps: 126/127 from missing commands, 124 from timeout, 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-parent to find the merge or PR in merge-heavy histories, then bisects inside it.
    • Uses --term-old / --term-new to 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.

    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. 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. 2

      Sign in to Agensi

      Your agent shows a sign-in link. Sign in and click Allow.

    3. 3

      Ask for what you need

      Your agent loads this skill and uses it on your task. It always asks before any payment.

    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

    Requires

    git
    A command that reproduces the bug
    Python

    Permissions

    Terminal / Shell
    Write Files
    Listed17 days ago

    What's inside

    Frequently Asked Questions

    No. The skill records your branch, HEAD and `git status` first, prefers a separate `git worktree` so your checkout is never touched, forbids commits, stashes and cleans during the bisect, and always finishes with `git bisect reset` and a check that everything matches the starting state.

    The reproduction script exits 125 for those, which tells git to skip them. If skipped commits end up surrounding the culprit, git reports a candidate range instead of one commit, and the agent reports that range honestly rather than guessing.

    Yes. The script repeats the check N times and calls a commit bad on the first failure. The skill gives the formula to choose N from the measured failure rate so the chance of wrongly calling a bad commit good stays under 1% (for example, 21 runs for a 20% failure rate).

    No. With `--term-old` and `--term-new` it finds when anything changed: a benchmark got faster or slower, output format changed, a warning appeared. For performance it uses a threshold and medians, and skips commits whose result is too close to call.

    No. It is plain git plus a shell script and works on any repository in any language. The skill includes dependency guidance for npm, pnpm, Cargo and pip. AgentHarness is a separate open-source tool and not required.

    New in Testing & Debugging