cd /news/ai-agents/cliffhanger-a-stop-hook-that-keeps-c… · home › topics › ai-agents › article
[ARTICLE · art-143302] src=dev.to ↗ pub= topic=ai-agents verified=true sentiment=↑ positive

cliffhanger, a Stop hook that keeps Claude Code from quitting early

A developer built cliffhanger, an open-source Stop hook and skill for Claude Code that blocks the agent from ending a turn while checklist items remain open, allowing a real stop only for named blockers, background tasks, plan mode, or after three automatic continuations. In a 12-task benchmark on a small app with a restrictive tool allowlist, Claude Sonnet 5.5 skipped running the test suite before its first stop in 6 of 12 baseline runs versus 0 of 12 with cliffhanger active, at roughly 4 percent higher cost. The regex detector behind the early-stop patterns flagged exactly the 6 test-skipping runs and none of the other 42 first final messages across all 48 runs.

by read2 min views8 publishedOct 1, 2026

I kept running Claude Code on long, multi part tasks overnight, and kept coming back to a summary that ended with an offer: "Want me to continue with the rest?" or "Once you approve it, I will run the tests." Nobody was there to answer, so the job stopped with work still owed.

Anthropic's own prompting guide for Opus 5.5 names four ways this happens: announcing the next step instead of taking it, offering to continue, listing decisions for the user that do not actually block the work, and treating a milestone as a good place to stop. I kept seeing all four in headless runs.

cliffhanger is a Stop hook plus a skill for Claude Code. On every Stop and SubagentStop event it reads the agent's own checklist, built from TaskCreate and TaskUpdate calls, the latest TodoWrite list, or a Markdown to do list the agent wrote in that turn. If items are still open, it blocks the stop and names what is left. It lets a real stop through: a line that names a blocker, background tasks still running that will wake the session later, plan mode, or a cap of three automatic continuations per user turn so it cannot loop forever.

I ran a benchmark: 12 multi part tasks (write code, update tests, run the full suite) on a small app, with a restrictive tool allowlist that only permits pytest, not python -m pytest. Under that allowlist, Claude Sonnet 5.5 skipped running the suite before its first stop in 6 of 12 baseline runs, usually right after a refused test command. With cliffhanger active, 0 of 12. The cost went up about 4 percent, mostly the extra turn it takes to run the suite before stopping.

The regex detector behind the early stop patterns, tested alone against the first final message of all 48 runs in the benchmark, caught exactly the 6 runs that skipped the tests and flagged none of the other 42. That is a small sample from one model on one fixture, and the method and raw tables are in the repo rather than just claimed in the README.

It only helps with Claude Code's Stop hook today, though an AGENTS.md version ships for agents that read plain instructions instead of hooks. The early stop patterns come from one failure mode on one fixture, so I expect to add more as they show up elsewhere.

cliffhanger is free, MIT licensed, and has no dependency beyond Python's standard library.

── more in #ai-agents 4 stories · sorted by recency
── more on @claude code 3 stories trending now
sponsored brought to you by zahid.host 4,200+ EU-deployed projects
reading about agents? ship yours in a single git push.

Run your AI side-project on zahid.host

EU-based hosting, git-push deploys, automatic HTTPS, no cold starts. Free tier with a custom domain — perfect for shipping the agent you just read about.

$git push zahid main
→ Live at https://your-agent.zahid.host ✓
Get free account → Pricing
from €0/mo · no card required
LIVE [news/cliffhanger-a-stop-h…] indexed:0 read:2min 2026-10-01 · —