decisions DECIDED

128. What enforces the git-clobber rule, now that it has crossed its own threshold

calef, 2026-08-25, in conversation, on the evidence below: "No repeat in three weeks seems like it isn't a problem any longer." Milestone 118 (CLAUDE.md has a budget)'s own violation ledger (notes/rule-violations.md) said the git-clobber rule sat at four open strikes, one past its own three-strike threshold, with no enforcement mechanism decided. It named this "calef's or the integrator's call, not this lane's." This entry lays out the real options researched for that call, and the decision: accept, no new mechanism, the ledger row marked resolved.

The real incidents, precisely

All three recorded rows trace to one day, 2026-08-04, not a spread pattern, and none since (notes/rule-violations.md, last run 2026-08-22):

  1. The squash-against-origin/main scar. A lane ran git reset --soft origin/main (instead of its own recorded base SHA) to squash checkpoints, and silently staged four other lanes' files as its own, including a deletion. Caught only by reading git status before committing (AGENTS.md, "Commits"). One instance.
  2. The aggregated "four agents" row. AGENTS.md's own "What it costs, measured 2026-08-05" section reports "four agents clobbered work with reset --hard, checkout or stash" on 2026-08-04, as one summary count rather than four individually detailed incidents. This is the ledger row currently sitting past threshold.
  3. The pkill -f incident. A lane killed another lane's QEMU mid-test. One instance, same day.

All agent-caused; none human-typed. Zero repeats in the three weeks since. That matters for weighing whether this is an ongoing pattern or a one-day cluster that predates a convention (AGENTS.md's own git-safety section) written in direct response to it.

What already exists to build on

script/setup already runs git config core.hooksPath .githooks, a shared, versioned hooks directory covering every worktree from the one .git this project's multi-lane structure shares. One hook exists there today: .githooks/pre-push, running script/fmt --check before every push (bypassable with --no-verify, the same escape hatch this project already accepts elsewhere).

No .claude/settings.json exists in this repo. Every incident above went through Claude Code's own Bash tool permission system (100% agent-caused, via the Bash tool). That system is currently unconfigured for this class of command.

The options, sized rather than asserted

The decision

Accept, mark the ledger row resolved, add no new mechanism. The recommendation researched here was priced and available: deny reset --hard, clean -f, and branch -D in .claude/settings.json. That is the cheapest option that actually prevents rather than merely discourages, targeting the layer every real incident went through. But calef's read of the evidence decided it differently. All four incidents trace to a single day, 2026-08-04, and the three weeks since have carried zero repeats. That reads as AGENTS.md's own prose already doing the job, not as a dormant risk waiting to recur. That prose is the "move fast on what can be undone" section, the squash-against-base-SHA scar, and the worktree-pruning warnings, all written in direct response to that day. Building a new technical control on top of a rule that has not been broken since would be solving an already-solved problem.

notes/rule-violations.md's git-clobber row is marked resolved on this basis. The concern is resolved, not the underlying AGENTS.md rule, which is untouched and stays the active guard.

checkout <path>'s ambiguity is recorded rather than solved, since no mechanism was going to be built either way. It cannot be distinguished from ordinary branch switching by prefix alone, in a shim or in a Claude Code deny rule. AGENTS.md's existing prose guidance (check git status before a destructive-shaped command; prefer stash over discard) remains the answer.

If the pattern recurs

The ledger's own exact-text matching means a differently-worded recurrence starts its own count rather than reopening this row. So a future reader hitting a new git-clobber incident should not assume this decision covers it silently. Re-raise the question with the new evidence. The options priced above (a .claude/settings.json deny rule being the strongest available one, checkout <path>'s ambiguity being the one gap nothing surveyed here closes) do not need re-researching from scratch.