The sentence
CLAUDE.md:692, in Workflow norms:
Guard the REVERT, not the edit:
git checkout -- <file>is the safe restore.
The intent is right and the spelling has a hole.
The measurement
git checkout <sha> -- <file> updates both the index and the worktree. A later
bare git checkout -- <file> restores the worktree from the index — which now
holds the old content — so the "restore" hands back the version that was being
reverted.
git checkout <old-sha> -- compiler/x.inc # index AND worktree now hold OLD
<measure the control>
git checkout -- compiler/x.inc # restores OLD out of the index <-- wrong
git checkout HEAD -- compiler/x.inc # restores HEAD <-- right
Measured 2026-09-06 by frankwasm, which then read its own sha round-trip check as a walked seed when it was a reverted source — a wrong diagnosis of a correct alarm.
Why it matters more than a typo
The rule routes you into it. Guard the revert is the advice for exactly the situation that uses the sha form: proving a fix by removing it. So the population that follows CLAUDE.md's guidance most carefully is the population that hits this — during a positive control, when the tree is deliberately holding a reverted fix and a wrong restore is least likely to be noticed.
And the failure is silent in the direction that reads as a compiler problem. The next build produces a binary from the old sources, and the tell (a changed sha, a fixedpoint that no longer matches) looks like the documented two valid fixedpoints case rather than like a bad restore.
The proposed change
Replace with git checkout HEAD -- <file>, which is correct in both situations —
after a sha checkout and after a plain edit — and add the reason in half a line, since
the two forms are indistinguishable by inspection:
git checkout HEAD -- <file>is the safe restore. Not the bare form:git checkout <sha> -- <file>writes the INDEX too, so a barecheckout --afterwards restores the reverted content out of the index.
Why this is a ticket and not a patch
NOT DISPATCHABLE — do not claim it. No agent may edit CLAUDE.md, and no agent may
edit it because a peer asked; a peer cannot relay an authority the owner holds. What
this ticket provides is the sentence, the measurement and the replacement text in one
place, so the change costs the owner one read.
2026-09-06 — DONE. The owner instructed the edit; it landed at fe0c7e2cd.
CLAUDE.md now reads:
Guard the REVERT, not the edit:
git checkout HEAD -- <file>is the safe restore. NOTgit checkout -- <file>, which restores from the INDEX — so after anything that staged content (aclaim, a partialadd, a sha-form checkout) it faithfully re-applies the very state you are trying to back out of, and reports nothing.
The ticket's own blocking condition — "no agent may edit CLAUDE.md, and no agent may edit it because a peer asked" — was met the only way it can be: the owner asked for it directly, in his own session, with the correction in front of him. That is worth noting rather than just closing on, because the ticket was filed as not-dispatchable and it stayed not-dispatchable; what changed was the owner's attention, not the rule.