evnchn-agentic

Claude Code Stop Gate — Development skill for Claude Code

Development community

Stop gate hook for Claude Code — nonce-based confirmation prevents accidental session termination, enables overnight autonomous work.

How to install Claude Code Stop Gate

This entry records only its repository, not the path inside it, so there is no exact command to give. Open evnchn-agentic/claude-code-stop-gate and copy the folder into ~/.claude/skills/, or the file into ~/.claude/agents/.

What Claude Code Stop Gate does

Stop gate hook for Claude Code — nonce-based confirmation prevents accidental session termination, enables overnight autonomous work.

Alternatives in Development

  • Cashclaw — An autonomous agent that takes work, does work, gets paid, and gets better at it 973 ★
  • Stop Review Gate — You are reviewing uncommitted changes before the author finishes their turn 664 ★
  • Taskmaster — Stop hook for Claude Code that keeps the agent working until all plans and user requests are 100% complete 494 ★

README

⚠️ DEPRECATED — no longer needed on Claude Opus 4.8+

The silent-stop failure this hook guarded against (the model ending a turn text-only when the task still needed a tool call) was **fixed model-side in Opus 4.8**, not in the Claude Code harness — so the guard is now redundant on 4.8+. Keep it only if you run **Opus 4.7 or older**, where the failure mode returns and you'd be unguarded.

**Full bisect (harness vs model) + evidence:** https://github.com/evnchn-agentic/claude-code-stop-gate/issues/2

This repo is **archived** as a deprecated reference. The hook still works.


claude-code-stop-gate

**One script that prevents Claude Code from accidentally ending a session -- enabling true overnight autonomous work.**

The agent said "continuing overnight work" but the loop ended because no tool call was made. This hook fixes that.


The Problem

Claude Code's agentic loop ends when the assistant produces a response with no tool calls. An agent can *intend* to keep working but phrase its response as text ("I'll continue overnight") instead of making a tool call -- and the session silently dies.

The human wakes up to find nothing happened.

The Fix

A `Stop` hook that fires every time Claude tries to end its turn. It:

  1. Generates a random nonce and blocks the stop
  2. Reminds Claude with a 6-point checklist (see below)
  3. Requires explicit confirmation -- Claude must include STOP_CONFIRMED_ to actually stop
  4. If Claude has more work, it just continues with a tool call -- no confirmation needed

The nonce prevents Claude from pre-generating the confirmation string. It must genuinely decide to stop *after* seeing the reminder.

The Checklist

When the hook fires, Claude is reminded to:

  1. Review task list -- any incomplete tasks?
  2. Review user messages -- did you miss anything?
  3. Continue overnight work -- make a tool call if work is queued
  4. Clean up background commands -- terminate any that ar