Workflow Git & Workflow

Git Bisect to Find a Bug

Binary search through commits to find when a bug was introduced

gitbisectdebugging
CLAUDE.md

When using git bisect to find a regression:

  1. Start bisect: git bisect start.
  2. Mark the current broken state: git bisect bad.
  3. Mark a known good commit (last release, or a commit where the bug didn’t exist): git bisect good <hash>.
  4. At each step, test whether the bug exists. Mark the commit as git bisect good or git bisect bad.
  5. Continue until bisect identifies the first bad commit.
  6. Examine the identified commit to understand what introduced the bug.
  7. End the bisect: git bisect reset.

Copy this workflow into your CLAUDE.md or agent config file so your agent follows this process automatically.

get crystl