Developer snapshots each agent round to a git ref and bisects to find regressions
11/02/2026 — 11/02, 09:18·1 sources (all)·1 reports (all)
Key takeaways
- A developer built a Claude Code Stop hook that commits each agent round's changes to a private git ref, leaving the main branch, staging are…
Background & analysis
On 2026-11-02 at 09:01, DEV Community's AI section published a walkthrough by developer xgabriel describing a workflow for tracking an Agent's changes with git. The approach starts with a Claude Code Stop hook that commits the Agent's work at the end of each turn into a private git ref, leaving the main branch, the staging area, and any stash untouched. Once every round is captured as its own snapshot, a script walks those snapshots through a bisect inside a temporary worktree, pinpointing exactly which turn introduced a regression and broke a test that had been passing before.
The scenario motivating the technique is a familiar one. The Agent reaches turn 20 and reports that the refund endpoint is finished, but running the suite shows test/refund.test.ts failing on a case that passed an hour earlier. Something changed somewhere between turn 1 and turn 20, and nothing in the repo makes that obvious, because the Agent never commits and the whole session's work sits in a single working-tree diff. A quick git log returns only the commit the session began from and nothing after it, so there is no commit-level trail to search.
By adding a Stop hook and a private ref per turn, the workflow restores the missing history in a way that does not interfere with normal git usage. The bisect script then checks out the recorded snapshots one at a time in a throwaway worktree, reruns the test at each step, and identifies the offending turn. The write-up presents this as a practical pattern for developers working with Claude Code, where long Agent sessions can silently accumulate changes across many turns. No broader adoption, tooling changes, or follow-up discussion beyond the article itself are documented.
AI-generated from 1 reports · updated 4 days ago
- Heat index
- 25
- All sources
- 1
- All reports
- 1
- First seen
- 4 days ago
Reports on this story headlines open the original
A developer describes using a Claude Code Stop hook to commit every agent turn to a private git ref, leaving the branch, staging area and stash untouched, then bisecting those snapshots in a scratch worktree to find which turn broke a test that used to pass. The approach targets agents that never commit, leaving 20 turns of edits as a single diff.
DEV Community · AIAI score 63
Other stories people are talking about
- Heat index 840OpenAI ships Images 2.6 with GIF and SVG output15 sources
- Heat index 675OpenAI says its cyber model pipeline confirmed 1,724 Linux kernel flaws and generated 948 privilege-escalation exploits11 sources
- Heat index 642RisingOpenAI GPT-5.6 Brings Major Agentic and Computer Use Upgrades13 sources
- Heat index 633RisingCat Wu, product lead for Claude Code, joins OpenAI9 sources
- Heat index 630NewSurgeOpenAI releases GPT-6 Cyber cybersecurity model7 sources
How is heat calculated?About the methodHide
Heat counts how many independent sources covered a story in the last 48 hours: one source counts once no matter how many posts it published, decaying with a 24-hour half-life. What ranks first is what many people are talking about.
This page aggregates public feeds. Headlines and summaries are machine-organized and remain the property of the original authors; verify important facts at the source. If you believe a headline or summary infringes your rights, email the contact address in the footer with the page URL and basis of your claim, and we will remove or replace it after review.
- Surge
- Discussion rising fast
- New
- First report within 6 hours
- Rising
- Still gathering discussion

