Check-before-finishing Stop hook

The idea

In a native Claude Code round, a Stop hook that uses no model holds the round once if code changed after the last passing check. A piped or masked status does not count as a pass.

The problem
A delegate can finish after an edit without running the checks again, or hide a failing status.
Why it matters
Running the checks after the last edit becomes a rule, not an instruction.
Where it stands
In production as of

A step-by-step replay of this idea is not published yet. The library adds one when a recorded run shows it.

  • Native implementation round

    Implementation runs as one sandboxed Claude Code or Codex session, briefed by a compiled file. Its tools go through the gateway hook. The supervisor gets back only the report, the diff and the checks.

  • Gate ledger

    A registry names each gate and the failure it prevents. From records, it counts how often the gate caught that failure and how often a person overruled it.

Turn the numbers into shipped work.

Crewshal runs these choices for you: a persistent AI worker with memory and rules, on your Claude and Codex subscriptions.