← Browse by Chapter
Get the Book →
#108Chapter 20 — Debugging with Claude Code
This worked at [good tag or commit] and fails at [bad commit]. Check that no tracked file has uncommitted changes, and stop if one does. Move the reproduction outside the repository and write a script next to it that builds the project, copies the reproduction in, runs it and removes it. The script exits 125 if the build or the copy fails, 0 if the reproduction passed and 1 if it failed. Run it at both ends first: it must exit 0 at the good one and 1 at the bad one, or stop and tell me. Check our branch out again, run git bisect with the script, and show me the first bad commit, its diff and the reproduction's output there. Then run git bisect reset, confirm that our branch is checked out, put the reproduction back, and run it once to show that it still fails.

Mastering Claude Code
These prompts are excerpts from the book. Get the full collection with explanations and use cases.