Skip to main content

RealStop

Built to block hand-backs from coding agents and let real approval stops through.

RealStop is a research preview of a Claude Code Stop hook plus a skill. When the agent tries to end its turn, a judge reads the stop. If the agent is handing back work it could do itself ("The requested tests are still missing. Want me to add them?", "I'll do that next", "you'll need to run this"), the hook sends it back to work. RealStop calls that stop a quit. If the agent stopped for something only you can approve (a deploy, a publish, a payment, a login only you have), the stop goes through. The block message is approval-first: it states the approval rule before anything else, so the agent must still ask before it deploys, sends, spends or deletes, and the nudge never tells it to go ahead. In two small retests with two revised variants of the message, agents made 0 of 32 attempts at approval-gated actions, against 29 of 36 with the old message. Zero attempts is not a guarantee. Approval enforcement belongs in the harness.

The hooks, the skill and the phrase rules are always on. On top of them you choose who judges each stop: a small DecisionTune model on your Mac (the default), a cloud decision model, or the rules alone. On 864 test turn ends from real sessions, the local model (moderate) caught 67.5% (195 of 289) of hand-backs at 15.8% (91 of 575) false interventions, against 56.7% (164 of 289) at 14.6% (84 of 575) for the phrase rules on the same rows. A false intervention is a right stop that the hook blocked. On an Apple M5 Pro (macOS 27.2), the shipped model answers in a median of 27 ms (p95 33 ms) once warm, and the full hook takes a median of 186 ms per stop (136 ms when a reply under 400 characters skips the model). In local mode, RealStop sends no prompt or reply text to an outside judge. Claude Code itself still talks to its provider.

In live runs, RealStop removed closing offers. The pilots were too small to show that agents finish more work. All data come from one developer's sessions (see Limits).

git clone https://github.com/decision-tune/realstop && cd realstop && uv tool install . && realstop setup

Install

From a clone, uv tool install . or pipx install . gives you the realstop command. bash install.sh also works. It installs the package (uv, else pipx, else pip install --user) and runs realstop setup. It also accepts the flags --judge, --strength, --pause, --resume, --diagnose, --uninstall and --keep-server, and maps them to the commands below.

realstop setup                  # first-time install; asks which judge (1 local model, 2 cloud decision model, 3 rules); safe to re-run
realstop judge local|jev|rules  # local: the model, rules as backup; jev: the cloud decision model (see Privacy); rules: nothing else needed
realstop strength light|moderate|hard   # moderate is the default
realstop learn                  # review your corrections (--list, --undo ID, --reset, --status)
realstop pause | resume         # pause or resume RealStop
realstop status                 # judge, strength, paused?, server up?, corrections waiting, versions
realstop diagnose               # redacted summary for bug reports
realstop serve [--keep]         # start the local model server; --keep installs the LaunchAgent (macOS)
realstop uninstall              # remove RealStop's entries and files

The realstop command needs Python 3.9+ and uses only the standard library. The tests also need jq and bash 3.2+. The local model server needs Apple silicon and Python 3.10+, and it sets up its own venv (see below).

On a first install from a terminal (no --judge, nothing stored yet), realstop setup asks which judge to use. Option 1 is private and local, and Enter picks it. Option 2 is the cloud decision model. Setup reads your key with no echo and falls back to option 1 if you give none. Option 3 is rules only. Piped, CI and plugin installs never ask. They use the local default and print how to change it (realstop judge local|jev|rules). A re-run keeps your stored choice.

The repo does not contain the model file. realstop setup fetches it (see MODEL.md) and checks its sha256. It does not download again when the checksums match. For no model at all, run realstop judge rules. If the download fails for any reason, setup says so and the hook uses the phrase rules.

Setup writes the three hooks and config.json in ~/.claude/realstop/, the skill in ~/.claude/skills/realstop/, and four hook entries in ~/.claude/settings.json. It edits settings.json atomically under a lock, after a timestamped backup. It refuses an invalid settings.json and never overwrites it. It also writes a sha256 manifest of the hooks and config, so the next stop detects a hand edit. Every option is in realstop --help.

Serve the local model

This runs in the foreground. Ctrl-C stops it.

realstop serve

The script uses DT_PY if you set it, else the venv ~/.claude/realstop/venv. If neither exists, it creates that venv with the first Python 3.10+ it finds and runs pip install "decision-tune[mlx]==1.0.0" in it. That takes network and about 1 GB of disk, once. REALSTOP_NO_INSTALL=1 turns the install off. Until a server answers on 127.0.0.1, the hook decides with the phrase rules. A stopped server costs you only the model's extra catches.

As a Claude Code plugin

The repo is also a Claude Code plugin and a one-plugin marketplace (decision-tune):

claude plugin marketplace add decision-tune/realstop
claude plugin install realstop@decision-tune

Or do it in one step inside a session: /plugin install realstop --marketplace decision-tune/realstop. To try a local checkout, run claude plugin marketplace add ./realstop, then the same install line. The plugin registers the four hooks itself (hooks/hooks.json, run through ${CLAUDE_PLUGIN_ROOT}). It also ships the skill (skills/realstop/).

The plugin installs no model and does not create ~/.claude/realstop/config.json. With only the plugin, the judge is the phrase rules. For the local judge, run realstop judge local, then serve the model as above. The plugin is already enabled, so the installer registers no second set of hooks. The plugin's hooks read the same ~/.claude/realstop/config.json. Two things differ from the realstop setup-only path. The 7-day gentle mode starts only when realstop setup ran. The tamper manifest checks only the copies in ~/.claude/realstop/.

Both ways at once is safe. If the plugin is enabled, realstop setup adds no hooks to settings.json and removes its own earlier entries on the next run. If realstop setup came first and you add the plugin later, both copies fire. The second copy backs off from a stop or prompt the first already handled (a 30 s lock in ~/.claude/realstop/state/). Re-run realstop setup after adding the plugin to drop the duplicate entries. Still, use one or the other: both install the skill, so you will see it twice until you remove one.

Pause and uninstall

Pause or bypass, instantly. In any Claude Code prompt, type realstop off, and every stop goes through until you type realstop on. Type let it stop, and this session's next stop goes through once. Only a prompt that is exactly one of those phrases counts. From a terminal, use realstop pause and realstop resume. A fresh install is also gentle for its first 7 days (at most one nudge per user turn) unless you run realstop strength yourself.

Uninstall. realstop uninstall removes only what RealStop added: its four hook entries in settings.json, its files in ~/.claude/realstop/, its skill folder and the optional LaunchAgent. Every other key and hook in settings.json stays, and your standing.txt is kept. It never removes shared folders. If settings.json is not valid JSON, setup and uninstall refuse, explain, and leave it untouched.

Choose a judge

judge how to pick it quits caught, test false interventions, test text sent to an outside judge cost
Local DecisionTune model, moderate default, option 1 67.5% 15.8% no (loopback server only) free
Cloud decision model option 2, realstop judge jev not reported not reported yes, every judged stop paid per use
Phrase rules option 3, realstop judge rules; always on as backup 56.7% 14.6% no free
  • Private and local. Our pick if your code should stay on your machine. A small DecisionTune model runs on your Mac. On an Apple M5 Pro (macOS 27.2), the shipped model answers in a median of 27 ms (p95 33 ms) once warm, and the full hook takes a median of 186 ms per stop (136 ms when a reply under 400 characters skips the model). RealStop sends no prompt or reply text to an outside judge.
  • Cloud decision model (opt-in). Pick it with realstop judge jev (or --judge jev) and a key. It is paid per use and sends the stop's text to the cloud decision model's provider (see Privacy). We make no quality claim about it either way.
  • Rules only. No model at all, nothing to download.

Strength. A higher strength catches more quits and blocks more right stops. Moderate is the default. Light is the setting for about 10% false interventions: 9.7% (56 of 575, interval 7.7 to 13.0). If false interventions bother you more than missed quits, use --strength light. Each strength's numbers are in the test-split table.

How a stop is decided. The deterministic rules go first: a live "stop" from you, plan mode, a real harness denial, or an approval you wrote into the request. Then comes the judge you chose: the local model, or the cloud decision model, which runs only if cloud_ok is true. Under --judge auto, the cloud decision model runs only when the local model gave no answer. The phrase rules come last. Replies under 400 characters skip the model and go to the rules. After a nudge, the hook blocks again only if a tool call followed it, at most 5 times per user turn. Hooks fail open: any error allows the stop and is logged by exception type, never by text.

When a stop is let through for approval. Only on evidence, of three kinds:

  • A harness denial the reply names. It excuses only the denied step. A reply that also defers other work behind it, like "If you approve pytest, I'll make that edit", is blocked.
  • A request of yours that names the approval requirement, plus a reply that asks consent for that same action.
  • A consent sentence for a listed approval step: publish, force push, production deploy, destructive SQL, sending an email, a payment, and similar.

The reply's own words never excuse a stop. Details, the config keys and the shadow mode (log, never block) are in docs/REFERENCE.md.

Steps handed to you. The rules block a reply that ends by handing you a command to run or paste, or an approval it could run itself. The exception is when the harness denied that same command this turn and the reply names the denial. List the steps you have approved for good in ~/.claude/realstop/standing.txt, one phrase or regex per line. install.sh writes that file once and never overwrites it. When the agent asks consent for one of those steps, the stop is blocked and the agent is told you pre-approved it. Only a sentence that actually asks or hands you a step counts. Text that merely describes your approvals does not.

How well it works

The data are 3,640 model-labeled turn ends from 133 real sessions of one developer (127 Claude Code, 6 Codex CLI). The splits are train 1,805, dev 277, select 694 and test 864. Test sessions are kept separate from the other splits. Dev and select share sessions with train (274 of 277 and 685 of 694 rows).

The most common hand-back is a polite offer after finished work. In these turn ends, offers and menus of options that block nothing were 61% (764 of 1,253) of quits. A closing offer counts as a quit unless the offered step needs you. Under an approximation of a stricter earlier rule, the share was 21.9%.

Test split. The local model at each strength and the phrase rules were scored the same way on the same 864 test turn ends (289 quits, 575 right stops) from 21 sessions. "Quits caught" means quits blocked. "False interventions" means right stops blocked. Intervals are 95%, resampling whole sessions.

judge quits caught false interventions
local model, light 53.6% (155 of 289) 9.7% (56 of 575)
local model, moderate (default) 67.5% (195 of 289) 15.8% (91 of 575)
local model, hard 75.4% (218 of 289) 22.8% (131 of 575)
phrase rules 56.7% (164 of 289) 14.6% (84 of 575)
  • Local model against the rules, same rows. The local model caught more quits: +10.7 points (interval +4.4 to +14.9). False interventions: +1.2 points (interval -3.3 to +5.4), no detectable difference.

Approval-first block message. The block message opens with the approval rule. Two small live retests on Claude Opus 5.5 tried two revised variants of it: agents made 0 of 32 attempts at approval-gated actions, against 29 of 36 with the old message. In them, the block message was sent on purpose at stops that correctly waited for approval, which the hook itself did not block. Zero attempts is not a guarantee, and the exact rates are uncertain. Approval enforcement belongs in the harness: the message and the pattern lists are not an authorization boundary. The message still has a side effect. In the second retest, which used the shipped variant, agents nudged after finished work made unrequested edits in 28% (5 of 18) of trials, against 61% (11 of 18) with the earlier message. In the first retest this measure went the other way (6 of 6 against 2 of 6), so it is noisy.

Live runs with the hook on and off. RealStop's main live effect was removing closing offers. We ran the same tasks on Claude Opus 5.5 and Claude Sonnet 5.5, with the hook on and off, using the phrase-rules judge. On Sonnet, 12 offer stops became 0. The hook caused no attempts at approval-gated actions. The pilots were too small to show that agents finish more work. On Sonnet, 31 stops left work undone with the hook on, against 28 with it off. Most of that unfinished work was reported as done, which the judge cannot check.

What it misses.

  • Quit types other than offers. At moderate, the shipped model caught 82% (127 of 154) of offers on the test split. On the public synthetic set, the phrase rules and an earlier version of the model blocked none of four other quit types: deferral, a false "done", a command handed over untried, and handing work to the user.
  • Short replies. Short replies score low, so replies under 400 characters skip the model and go to the phrase rules alone. A short quit that the rules do not match goes through.
  • Paraphrases and bare claims. The rules miss a paraphrase outside their vocabulary. The judge reads the request, the end of the reply, a tool-call count and a background-work flag, and the rules read tool results for denials. Neither can check whether claimed work was done, so a bare "Done." can pass.

Privacy, per judge

  • Local model and phrase rules. RealStop sends no prompt or reply text to an outside judge. The local judge talks only to a server on 127.0.0.1. scripts/realstop-serve.sh, which realstop serve runs, binds nothing else. The hook refuses any local_url that is not 127.0.0.1, ::1 or localhost. Loopback is an address on your own machine with no login, so other programs running as you can reach it. Claude Code itself still talks to its provider, outside RealStop.
  • Cloud decision model (opt-in). It runs only after realstop judge jev. A key alone never turns it on. Each judged stop sends the end of your request (its last 1,500 characters), the start and end of the reply, the tool names and up to 8 learned examples, unredacted, to the cloud decision model's provider. Read the provider's terms before you turn it on. It is paid per use, at $0.042 per million input tokens (the provider's published price).
  • Downloads. Install downloads the model from Hugging Face, once, and verifies its checksum. It skips the download when the checksums already match, and realstop judge rules fetches nothing. The decision-tune package comes from PyPI when you first serve the model. Those downloads send no prompt or reply text.

Learning from your corrections

In the same turn. Say "no", "that's wrong" or "do this yourself", and a second hook notices. In that same turn it tells the agent to name the miss in one line and do the work. It matches phrases, so a correction worded another way is missed. Each correction is logged on your machine, with emails, home paths and long tokens masked.

Later, when you review them: realstop learn. Nothing is learned until you say yes.

realstop learn             # review pending corrections, newest first: [y]es, [n]o, [f]lip label, [s]kip, [q]uit
realstop learn --list      # every stored example and the current strictness shift, with its reason
realstop learn --undo <id> # remove one example
realstop learn --reset     # remove everything learned; back to as-shipped
realstop learn --status    # counts: pending, stored, strictness shift
  • You confirm each one. Each pending correction shows the agent's ending, the model's score and a proposed label. A stop let through that you then corrected is proposed as a quit. A block you pushed back on is proposed as a right stop. Nothing changes until you answer y.
  • A terminal is required. The review, --undo and --reset need a terminal, and they refuse when agent environment indicators are present (CLAUDE_PID, CLAUDECODE or another variable listed in docs/REFERENCE.md). This is not proof that a person is present, and it is not a security boundary. --list and --status only read. q keeps the answers you already gave. install.sh links the realstop command into ~/.local/bin when that folder exists. Otherwise run ~/.claude/realstop/realstop learn.
  • Local model. On each confirm, RealStop stores the model's internal reading of that stop on your machine. It then refits a personal copy of the model's 4 KB decision head on your confirmed examples. The refit is held close to the shipped head, so a few examples shift the decision a little. The personal head is used only if it passes a check on the released synthetic pairs (data/regression_pairs.jsonl, 229 quit and right-stop pairs). Pairs-both-right and accuracy may drop by at most one point. It may block no more right stops than the shipped head. Every example you confirmed must land on the side you chose. Otherwise the update is refused with the reason, and the previous head stays. The shipped model files are never changed.
  • Strictness. After 4 more confirmed corrections in one direction than the other, the block threshold moves by 0.02, at most 0.10 in total from the shipped value. The shift is shown and undoable like the examples.
  • Cloud decision model. Its examples and its bar go through the same review. Nothing is learned automatically for any judge. Phrase-rules-only users are told that learning needs the local model or the cloud decision model.
  • Stored on your machine. Examples are stored locally in ~/.claude/realstop/learned/. Learning itself sends nothing off your machine. With the cloud decision model, each judged stop includes up to 8 of them (see Privacy). Each stop logs the shipped score and your personal score, so every learned influence is visible.
  • What it can learn from. It learns only from corrections the phrase hook detects. It learns only from stops the local model or the cloud decision model judged, so a stop the rules decided alone cannot be learned from. A handful of examples shifts the decision near those stops. New kinds of stops still need the shipped model. With the local model, realstop learn needs its server running (realstop serve).
  • Measured effect. On the public synthetic set, where the shipped model is weak, 5, 20 and 50 confirmed corrections raised the share of quits caught by about 2.5, 5.8 and 6.6 points, with false interventions unchanged (an offline simulation, tests/learn_eval.py). The learning settings were chosen on that same set, so these gains are optimistic.

Limits

  • The data are one developer's sessions and that developer's definition of a quit. Results may not hold for you.
  • Claude models made the labels. A blind human check of 30 labels agreed on 78% (21 of 27) of the items it could decide (kappa = 0.55).
  • The test split is not a fresh holdout: it was used during development. It has 21 sessions, so the intervals are wide. On a sealed held-out set, an earlier version of the model showed no detectable difference from the phrase rules.
  • The two live hook-on and hook-off tests were too small to show whether blocking changes how much work agents finish.
  • Learning from corrections was measured only on the public synthetic set. How much it helps on real sessions is not measured yet.
  • English only.
  • Steps that need your approval, and approvals you wrote into a request, are found by pattern lists. An unlisted command gets a neutral nudge.
  • The tamper manifest only detects edits: an agent running as you can rewrite it. A real boundary needs the hook and config outside the agent's write access.
  • More in docs/REFERENCE.md, "Known limits".

Tests

bash tests/run.sh          # offline, temp HOME, no network, cloud decision model off; every fixture is synthetic
python3 scripts/leak_check.py   # fails if a tracked file holds internal notes, names or paths

The fixtures under tests/regressions/ are synthetic stand-ins written for this repo. The training data are not released.

Support

Run realstop diagnose and paste its output into a bug report. It lists versions, the judge, config keys, hook registration, and the last 10 decisions as path and rule labels. It prints no reply or request text, keys, session ids, settings contents or paths, and your home shows as ~. Read it once before posting. Never paste your settings.json, stops.jsonl or an agent reply into a public issue. Report a security problem privately through SECURITY.md. Anything else: hello@decisiontune.com.

License

Apache-2.0 for the code and the model, the same license as DecisionTune. Copyright 2026 DecisionTune contributors. How the model is fetched and checked: MODEL.md. A technical report will follow. Benchmark: RealStopBench.

Metadata

Release files for realstop 0.1.1

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Source distribution (sdist)

Source distribution for realstop 0.1.1
File Size Uploaded Provenance Actions
realstop-0.1.1.tar.gz 136.9 kB Without provenance Details for realstop-0.1.1.tar.gz

Built distribution (wheel)

Table of built distributions (wheels) for realstop 0.1.1
File Interpreter ABI Platform Actions
realstop-0.1.1-py3-none-any.whl Python 3 none any Details for realstop-0.1.1-py3-none-any.whl

Total release size: 285.6 kB

Release files / realstop-0.1.1.tar.gz

Download URL realstop-0.1.1.tar.gz
Size 136.9 kB
Tags Source
SHA-256 checksum
How to use checksums
4938bf994c7a9916d3b699d2ef73f6ff4a42dc3b7bee589ca0782fd8800e0378
BLAKE2b-256 checksum
How to use checksums
10fe9ffbfa611264bfc29f1b8f50385d299096df4a777ace2e03a009e323738c
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Release files / realstop-0.1.1-py3-none-any.whl

Download URL realstop-0.1.1-py3-none-any.whl
Size 148.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
bc0c3663cf68576d02b0cfec59fbf8ea076b995c50c2d2a277ed55217a94ec3e
BLAKE2b-256 checksum
How to use checksums
58394a37fe0a5778940ba848e11b46db8b1cc4206a7d4c2456e9c920dee8400a
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.13.13

Security for realstop 0.1.1

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

0.1.1 This release

2 release files No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page