v0.3.2 · MIT · Claude Code & Cowork

Stop AI coding agents from quitting early.

AntiStallClaude is a harness-enforced Stop hook that blocks the “announce-then-halt” drift — where an agent ends a turn with unfinished, authorized work. Advice in a config file gets rationalized away. A hook can’t be. Since 0.3.0 the agent can start a sprint, but only a person can end it.

On 0.1.0? Update to the current version, 0.3.2. Version 0.1.0 had a Stop-hook bug that could loop and burn tokens. Replace antistall-gate.py or re-run install.py.

The problem

Autonomous agents stall mid-task. With work still queued and nothing actually blocking them, they write a tidy “here’s what I did, next I’ll…” summary — and stop. The tell is consistent: the moment the agent composes that summary, it has already decided to quit.

A CLAUDE.md rule

Advice. It lives in the model’s context and loses to in-the-moment reasoning (“clean checkpoint”, “the turn is long”).

A memory note

Same advice, different file. Degrades over a long session.

A system-prompt nudge

Still text the model weighs — same failure class.

A Stop hook ✓

A separate process the harness runs every turn-end. The model can’t reason its way past code that isn’t its to run.

How it works

While a sprint is armed, ending a turn is blocked. The agent can arm a sprint. It cannot turn one off. Only a person with the release passphrase can.

agent finishes a turn ─▶ harness runs antistall-gate │ sprint armed for this session? ── no ──▶ allow (silent) │ yes consecutive blocks ≥ cap (default 25)? ── yes ──▶ pause this one stop, stay armed, notify the human │ no ▼ { "decision": "block", "reason": "KEEP WORKING …" } ─▶ agent continues human runs "release" and types the passphrase ─▶ sprint ends (the only disarm)

Human-only disarm

Versions before 0.3.0 let the agent write a DONE ticket and switch the gate off. That exit is removed. release needs a passphrase that is stored only as a salted PBKDF2-SHA256 hash. arm refuses to run until a passphrase is set.

A password box, not a terminal

Tell the agent “disarm” and it runs release, which opens a masked password box on your screen (Windows). The agent can open the box. It cannot fill it.

One session, one gate

Sprint state is scoped to the session that armed it (0.2.1 and later). Two sessions in the same folder do not gate each other.

A pause, never a silent exit

After 25 blocked stops in a row the gate lets one stop through so a stuck agent cannot burn tokens forever. The sprint stays armed, you get a desktop notification, and the gate enforces again on the next turn.

When no sprint is armed, the gate is silent. Normal chat is never gated.

Install

git clone https://github.com/scottconverse/AntiStallClaude.git
python3 AntiStallClaude/install.py /path/to/your/project   # one project; defaults to the current dir
python3 AntiStallClaude/install.py --global                # user level (~/.claude), every project
# then RESTART the Code tab. Hooks load at session start

Cowork note: on current builds, user-level ~/.claude hooks do fire in Cowork’s Code tab (verified on claude-code 2.1.181), so the global install works. Each project still keeps its own sprint state.

Use it

python3 .claude/hooks/antistall.py set-release-secret                 # you, once: sets the passphrase
python3 .claude/hooks/antistall.py arm     "build the export pipeline" # agent or human
python3 .claude/hooks/antistall.py request "need prod DB creds"        # agent: notifies you, stays armed
python3 .claude/hooks/antistall.py release                             # you: passphrase ends the sprint
python3 .claude/hooks/antistall.py status

The done, blocked and question commands from 0.1 and 0.2 are gone. Use release --all to end every sprint in the project.

Honest about limits

It removes every sanctioned way for the agent to quit a sprint. It is not a sandbox: an agent with full file access on the same machine could still delete the gate or passphrase files. That is open tampering, not a normal exit. It enforces don’t stop early, not do good work, so pair it with tests and CI.

Archived October 17, 2026. This hook now lives in claude-hook-kit as sprint-gate, with the same human-only disarm. This repository is read-only.