Metadata-Version: 2.5
Name: realstop
Version: 0.1.0
Summary: Catches coding agents handing back work: a Claude Code Stop hook, its judge, and the realstop command.
License: 
                                         Apache License
                                   Version 2.0, January 2004
                                http://www.apache.org/licenses/
        
           TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
        
           1. Definitions.
        
              "License" shall mean the terms and conditions for use, reproduction,
              and distribution as defined by Sections 1 through 9 of this document.
        
              "Licensor" shall mean the copyright owner or entity authorized by
              the copyright owner that is granting the License.
        
              "Legal Entity" shall mean the union of the acting entity and all
              other entities that control, are controlled by, or are under common
              control with that entity. For the purposes of this definition,
              "control" means (i) the power, direct or indirect, to cause the
              direction or management of such entity, whether by contract or
              otherwise, or (ii) ownership of fifty percent (50%) or more of the
              outstanding shares, or (iii) beneficial ownership of such entity.
        
              "You" (or "Your") shall mean an individual or Legal Entity
              exercising permissions granted by this License.
        
              "Source" form shall mean the preferred form for making modifications,
              including but not limited to software source code, documentation
              source, and configuration files.
        
              "Object" form shall mean any form resulting from mechanical
              transformation or translation of a Source form, including but
              not limited to compiled object code, generated documentation,
              and conversions to other media types.
        
              "Work" shall mean the work of authorship, whether in Source or
              Object form, made available under the License, as indicated by a
              copyright notice that is included in or attached to the work
              (an example is provided in the Appendix below).
        
              "Derivative Works" shall mean any work, whether in Source or Object
              form, that is based on (or derived from) the Work and for which the
              editorial revisions, annotations, elaborations, or other modifications
              represent, as a whole, an original work of authorship. For the purposes
              of this License, Derivative Works shall not include works that remain
              separable from, or merely link (or bind by name) to the interfaces of,
              the Work and Derivative Works thereof.
        
              "Contribution" shall mean any work of authorship, including
              the original version of the Work and any modifications or additions
              to that Work or Derivative Works thereof, that is intentionally
              submitted to Licensor for inclusion in the Work by the copyright owner
              or by an individual or Legal Entity authorized to submit on behalf of
              the copyright owner. For the purposes of this definition, "submitted"
              means any form of electronic, verbal, or written communication sent
              to the Licensor or its representatives, including but not limited to
              communication on electronic mailing lists, source code control systems,
              and issue tracking systems that are managed by, or on behalf of, the
              Licensor for the purpose of discussing and improving the Work, but
              excluding communication that is conspicuously marked or otherwise
              designated in writing by the copyright owner as "Not a Contribution."
        
              "Contributor" shall mean Licensor and any individual or Legal Entity
              on behalf of whom a Contribution has been received by Licensor and
              subsequently incorporated within the Work.
        
           2. Grant of Copyright License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              copyright license to reproduce, prepare Derivative Works of,
              publicly display, publicly perform, sublicense, and distribute the
              Work and such Derivative Works in Source or Object form.
        
           3. Grant of Patent License. Subject to the terms and conditions of
              this License, each Contributor hereby grants to You a perpetual,
              worldwide, non-exclusive, no-charge, royalty-free, irrevocable
              (except as stated in this section) patent license to make, have made,
              use, offer to sell, sell, import, and otherwise transfer the Work,
              where such license applies only to those patent claims licensable
              by such Contributor that are necessarily infringed by their
              Contribution(s) alone or by combination of their Contribution(s)
              with the Work to which such Contribution(s) was submitted. If You
              institute patent litigation against any entity (including a
              cross-claim or counterclaim in a lawsuit) alleging that the Work
              or a Contribution incorporated within the Work constitutes direct
              or contributory patent infringement, then any patent licenses
              granted to You under this License for that Work shall terminate
              as of the date such litigation is filed.
        
           4. Redistribution. You may reproduce and distribute copies of the
              Work or Derivative Works thereof in any medium, with or without
              modifications, and in Source or Object form, provided that You
              meet the following conditions:
        
              (a) You must give any other recipients of the Work or
                  Derivative Works a copy of this License; and
        
              (b) You must cause any modified files to carry prominent notices
                  stating that You changed the files; and
        
              (c) You must retain, in the Source form of any Derivative Works
                  that You distribute, all copyright, patent, trademark, and
                  attribution notices from the Source form of the Work,
                  excluding those notices that do not pertain to any part of
                  the Derivative Works; and
        
              (d) If the Work includes a "NOTICE" text file as part of its
                  distribution, then any Derivative Works that You distribute must
                  include a readable copy of the attribution notices contained
                  within such NOTICE file, excluding those notices that do not
                  pertain to any part of the Derivative Works, in at least one
                  of the following places: within a NOTICE text file distributed
                  as part of the Derivative Works; within the Source form or
                  documentation, if provided along with the Derivative Works; or,
                  within a display generated by the Derivative Works, if and
                  wherever such third-party notices normally appear. The contents
                  of the NOTICE file are for informational purposes only and
                  do not modify the License. You may add Your own attribution
                  notices within Derivative Works that You distribute, alongside
                  or as an addendum to the NOTICE text from the Work, provided
                  that such additional attribution notices cannot be construed
                  as modifying the License.
        
              You may add Your own copyright statement to Your modifications and
              may provide additional or different license terms and conditions
              for use, reproduction, or distribution of Your modifications, or
              for any such Derivative Works as a whole, provided Your use,
              reproduction, and distribution of the Work otherwise complies with
              the conditions stated in this License.
        
           5. Submission of Contributions. Unless You explicitly state otherwise,
              any Contribution intentionally submitted for inclusion in the Work
              by You to the Licensor shall be under the terms and conditions of
              this License, without any additional terms or conditions.
              Notwithstanding the above, nothing herein shall supersede or modify
              the terms of any separate license agreement you may have executed
              with Licensor regarding such Contributions.
        
           6. Trademarks. This License does not grant permission to use the trade
              names, trademarks, service marks, or product names of the Licensor,
              except as required for reasonable and customary use in describing the
              origin of the Work and reproducing the content of the NOTICE file.
        
           7. Disclaimer of Warranty. Unless required by applicable law or
              agreed to in writing, Licensor provides the Work (and each
              Contributor provides its Contributions) on an "AS IS" BASIS,
              WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
              implied, including, without limitation, any warranties or conditions
              of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
              PARTICULAR PURPOSE. You are solely responsible for determining the
              appropriateness of using or redistributing the Work and assume any
              risks associated with Your exercise of permissions under this License.
        
           8. Limitation of Liability. In no event and under no legal theory,
              whether in tort (including negligence), contract, or otherwise,
              unless required by applicable law (such as deliberate and grossly
              negligent acts) or agreed to in writing, shall any Contributor be
              liable to You for damages, including any direct, indirect, special,
              incidental, or consequential damages of any character arising as a
              result of this License or out of the use or inability to use the
              Work (including but not limited to damages for loss of goodwill,
              work stoppage, computer failure or malfunction, or any and all
              other commercial damages or losses), even if such Contributor
              has been advised of the possibility of such damages.
        
           9. Accepting Warranty or Additional Liability. While redistributing
              the Work or Derivative Works thereof, You may choose to offer,
              and charge a fee for, acceptance of support, warranty, indemnity,
              or other liability obligations and/or rights consistent with this
              License. However, in accepting such obligations, You may act only
              on Your own behalf and on Your sole responsibility, not on behalf
              of any other Contributor, and only if You agree to indemnify,
              defend, and hold each Contributor harmless for any liability
              incurred by, or claims asserted against, such Contributor by reason
              of your accepting any such warranty or additional liability.
        
           END OF TERMS AND CONDITIONS
        
           APPENDIX: How to apply the Apache License to your work.
        
              To apply the Apache License to your work, attach the following
              boilerplate notice, with the fields enclosed by brackets "[]"
              replaced with your own identifying information. (Don't include
              the brackets!)  The text should be enclosed in the appropriate
              comment syntax for the file format. We also recommend that a
              file or class name and description of purpose be included on the
              same "printed page" as the copyright notice for easier
              identification within third-party archives.
        
           Copyright [yyyy] [name of copyright owner]
        
           Licensed under the Apache License, Version 2.0 (the "License");
           you may not use this file except in compliance with the License.
           You may obtain a copy of the License at
        
               http://www.apache.org/licenses/LICENSE-2.0
        
           Unless required by applicable law or agreed to in writing, software
           distributed under the License is distributed on an "AS IS" BASIS,
           WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
           See the License for the specific language governing permissions and
           limitations under the License.
License-File: LICENSE
Classifier: Operating System :: MacOS
Classifier: Operating System :: POSIX :: Linux
Classifier: Programming Language :: Python :: 3
Requires-Python: >=3.9
Description-Content-Type: text/markdown

# 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](#limits)).

```bash
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.

```bash
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](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.

```bash
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`):

```bash
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-well-it-works).

**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](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.

```bash
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](docs/REFERENCE.md), "Known limits".

## Tests

```bash
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](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](MODEL.md). A technical report will follow. Benchmark: [RealStopBench](https://github.com/decision-tune/realstopbench).
