HOW-TO GUIDE
How to make Claude Code finish every step of a skill with a Stop hook
Based on a post by Arcos (@0xarcos) on X · Nov 27, 2026
You'll end with: A Claude Code setup where one gates.json contract tells four hooks what each skill must read, run, and report before Claude can stop.
Why it's worth having: In 21 days the author's Stop hook caught 422 skipped steps, blocked 126 early finishes, and found 168 answers given without opening the needed file.
At a glance
WHO IT'S FOR
Engineers and operations staff at plants, EPCs, and shops who run Claude Code skills for repeat work.
LEVEL
Advanced
COST
Free to read. The hooks are Python files that run in Claude Code on your own plan.
YOU NEED
Claude Code · Python · A skill with a written checklist · A gates.json contract file
The method, in short
- 1Keep CLAUDE.md to rules true on every task, move each job's rules into its own skill, and turn every must-never rule into a hook.
- 2Write gates.json with each skill's must_read files, must_run commands, and checklist, plus the deny and banned lists every hook reads.
- 3Add UserPromptSubmit, PreToolUse, PostToolUse, and Stop hooks; the Stop hook sends Claude back once, then lets it stop and warns you.
- 4Start the gate in observe mode, read .claude/gate.log daily for a week, fix false alarms in gates.json, then switch to enforce.
Read the full guide from @0xarcos on X
The X Article has every hook file, the gates.json contract, the 21-day block log, and a one-evening setup plan.
Credit: Arcos (@0xarcos) on X