Decision model reference
This page holds the facts of the decision model. Read it to find one fact. What Jev decides, where a run asks it and how to configure it are on Decision model (Jev).
On this page: decide.py reference · Settings · Evidence
decide.py reference
Command
python3 ~/.claude/hooks/decide.py --kind tier,effort,split "<state of unit 1>" "<state of unit 2>"
Give several states, or several --kind values, in one command. Each call costs the asking agent a
turn, and that turn is the real price.
| Argument | Effect |
|---|---|
|
One or more presets, joined by commas. |
|
A custom question. It needs two or more |
|
One option of the custom question, and when it is right. |
|
An id that the log record stores. |
|
Checks the script without the network and prints |
|
Facts about the choice, one state for each unit. With no state, the script reads standard input. |
Presets
| Preset | Question and options | Asked by |
|---|---|---|
|
Which model? |
|
|
How much reasoning? |
The same askers, and |
|
Split the unit or keep it? |
|
|
Hand a part of the plan to a child orchestrator or dispatch leaves? |
|
|
The |
|
|
The model of a whole run: |
|
|
The model of a judgment lens that re-checks its own objections: |
|
A custom question uses --ask "<question>" --option a="<when a is right>" --option b="<when b is right>".
The output reports it under the kind custom. The test adversary uses this form:
decide.py --ask "Model for the test adversary on this change" --option opus=<when> --option sonnet=<when>.
The criteria of each option are in PRESETS in deploy/templates/hooks/decide.py.
The eight questions summarizes them.
The state
The state is a fixed template. It holds files, lines, and yes or no for each signal. The signals are precedent, new test
class, new table, auth surface, contract change, cross-module, concurrency and every edit named.
The template for a unit is:
Unit: <noun phrase>. files: <n> · lines: ~<n> · precedent to copy: yes|no · new test class: yes|no · new table: yes|no · auth surface: yes|no · contract or protocol change: yes|no · cross-module: yes|no · concurrency: yes|no · every edit named in the brief: yes|no
Output and the UNSURE rule
decide.py prints one line for each question. That line is the whole result. With several states, each
line starts with [n]. The exit code is 0 for every answer, since an unsure or unreachable model is a
normal outcome. A usage error, such as an unknown --kind or an empty state, exits with 2.
| Line | Meaning | The asker |
|---|---|---|
|
The answer is confident and valid. |
Takes it and does not re-argue it. The source is |
|
The model could not separate the options. |
Decides itself. The source is |
|
The model is unavailable. |
Decides itself. Never retries and never blocks on it. |
|
The script refused to send the payload. |
Restates the state as facts, or decides itself. A refused state got no answer, so a restated state is not a second ask. |
UNSURE means the asker decides. After UNSURE, the asker uses the tables in Model and effort. For effort, the asker
uses medium. This is normal, and the asker never retries.
Confidence
The confidence is normalised: (p_top * n - 1) / (n - 1) over n options. A value of 0 is a coin
toss and 1 is certainty. The floor is 0.8. The effort question has its own floor of 0.7. A wrong
effort costs little, and an unsure one resolves to medium. On three options, 0.8 means a top
probability of at least 0.87, and 0.7 means at least 0.80. On three options, a split of 0.63 and
0.37 scores 0.45 and is UNSURE.
What leaves the machine
The state, the question and the option criteria all leave the machine. Pass facts about the choice:
sizes, counts, and which signals are present or absent. Write absence in words (auth surface: no).
Never pass code, file contents, credentials, hostnames, IP addresses, customer data or ticket text.
decide.py refuses the obvious secret shapes (secret-like). It also refuses a payload over 4000
characters (too-large). The check runs before the key is read, and the secret check comes first. The
check catches obvious secret shapes only. The agent must filter the payload.
Time limits
Each call stops after 8 seconds. When price-gate.py asks, the call stops after 3 seconds, inside the 5
seconds of the hook. After one unreachable answer, the script stops dialling and skips the remaining
states of the same command. Do not wrap the call in timeout. macOS has no such command, so the model
is never reached.
How price-gate.py treats the Pick line
The hook asks Jev itself at four points, with two questions:
| Point | Question | On UNSURE, or on any failure |
|---|---|---|
A main-loop launch of |
|
|
A main-loop launch of |
|
|
A main-loop launch of |
|
|
A |
|
|
These four asks send a descriptor of flags and counts, and the brief stays on the machine. The launch
applies only when the model is left out or is opus. FT_TIER_AB=0 turns the four asks off. The results
go to ~/.local/state/ft-ai-toolkit/tier-ab.jsonl.
For the other checks that read a Jev answer, the hook treats the source in the Pick: line like this:
Source in the Pick: line |
What the hook does |
|---|---|
|
The hook requires a |
|
The hook requires |
|
The hook requires a cited signal after the colon. The hook denies an override to |
The dash in the line can be -, -- or an em dash. One source can cover both the model and the effort.
Two sources name the model first, as in Pick: sonnet/medium - jev/self (unsure: effort).
The hook checks the transcript only when it can find the transcript. An error note in the line also
exempts the dispatch from the decide.py call.
The hook denies a dispatch whose Pick: line is missing or differs from the model and effort of
the call. It lists every missing item at once. The check applies when ft-developer or bugfix-agent
dispatches a coding agent, ft-ui-ux-design or a slice.
When the key is missing or the endpoint is down
decide.py fails open. It prints UNSURE no-key or UNSURE unreachable, writes the log line and
exits with 0. The orchestrator decides by the tables, and the source is self. price-gate.py is
also fail-open when it asks Jev itself. For a whole run, UNSURE gives sonnet and the dispatch’s own
effort. For a recheck, UNSURE keeps opus.
Where answers are logged
Every call appends one JSON line to ~/.local/state/ft-ai-toolkit/decisions.jsonl. The record holds
the time, the model, the state, the options, the probabilities, the result, the confidence, the cost,
the routed model and the latency. A payload that was refused is stored as <withheld: secret-like> or
<withheld: too-large>, not as text. A call with --tag adds a tag, and price-gate.py writes
price-gate there. Read the log to tune the confidence floor. A failure to write the log never costs a
decision.
Settings
| Variable | Default | Effect |
|---|---|---|
|
none |
The API key. If it is empty, |
|
|
The key file. Keep it at mode |
|
|
The decision model. |
|
|
The confidence floor. Values outside |
|
|
The decision log. |
The endpoint is fixed in the script (https://openrouter.ai/api/alpha/decisions), so the key goes
nowhere else. The script sends POST /api/alpha/decisions, and Jev returns probabilities for each option.
The settings of the hook swaps, such as FT_TIER_AB, are on Dispatch Economy Reference.
Evidence
The decision log is ~/.local/state/ft-ai-toolkit/decisions.jsonl. The shadow measurements below come
from the record deploy/evals/dispatch-economy-evidence.md (evidence §20 for the shadow runs).
Cost per answer, measured. One decision log holds 6698 calls from 2026-10-13 to 2026-11-02, for a total of $0.17. The median call took 349 milliseconds, and 8 of 10 calls took 233 to 511 milliseconds. The median call with a recorded cost cost about $0.000027. One call can hold several questions.
Share of DECIDED answers, in the same log. The log also holds replays and the closed shadow runs.
| Question | Questions asked | DECIDED |
Share |
|---|---|---|---|
|
3671 |
2561 |
70% |
|
401 |
274 |
68% |
|
95 |
57 |
60% |
|
874 |
498 |
57% |
|
1412 |
788 |
56% |
|
4951 |
1663 |
34% |
|
19 |
5 |
26% |
|
871 |
217 |
25% |
The grade is asked first; the shadows are closed. Jev answered four questions in shadow from
2026-10-16. The answers were recorded and never acted on. The shadow runs closed on 2026-10-20.
deploy/evals/shadow-report.py stays to re-read the logs. decide.py --shadow and the visible and
severity presets are removed.
| Question | Agreed with the agent | Outcome |
|---|---|---|
|
35 of 38 |
Asked first at Stage 1. |
|
12 of 23 |
Dropped. |
|
12 of 18, the misses all MAJOR → CRITICAL |
Dropped. |
|
No signal in 176 verdicts |
Ended 2026-10-17. It later returned as a live preset that |