bash_risk_gate.py | PreToolUse (Bash) | Read-only commands never reach Jev — including test runs (bunx/npx vitest), read-only git subcommands (git grep, ls-tree, merge-base, -C <dir>), a lone sed s/// filter and for/if/until scaffolding around read-only bodies, each checked flag by flag (a sed that could run a shell through e no longer passes). An outward-facing command (gh pr merge, git push, gh api -X DELETE, gh repo edit, terraform apply, helm upgrade, kubectl apply/delete, npm publish, …, also inside a for/if body, never matched inside a heredoc body) asks without one: nothing local is destroyed, so it scores low, but no local undo reaches a merged PR. So does git reset --hard, which discards uncommitted work. Otherwise one call, with git's answer to "is this inside a work tree?" in the state, asks: irreversible? could it kill the running session? named target or a pattern? allow / confirm / block. Denies a session-killing pattern or a confident block; asks when it is irreversible (p≥0.7), when a pattern widens it (p≥0.6), or when a confident confirm meets real stakes (p≥0.6); stays silent on the rest so the normal permission flow decides. Measured 2026-09-27 on the 0.23.0 log joined to session transcripts: 212 of its 608 prompts were the judge's, 127 of those a heredoc script editing a source file in a git repo, every one approved. Replayed live on 117 logged commands plus 20 built to be dangerous (25% held out): prompts on commands users always approved 40/48 → 1/48 (held-out 9/10 → 0/10); all 20 dangerous ones still ask or are denied (5 denied before and after); irreversible scores in 0.6–0.8 62 → 13, action 38 → 43 (not improved). Every path is logged — the fast path as read-only, a judge that is down, and each judged command's program family and a hash that joins it to its transcript. |
precompact_triage.py + sessionstart_reinject.py | PreCompact, SessionStart(compact) | Before compaction, judges every user prompt and assistant conclusion: is it a decision, correction, constraint or open question a future turn must honour, and has it been superseded? Writes the keep-set; after compaction, the SessionStart hook prints it back into context. The summary still gets written by Claude; Jev decides what it must not lose. |
subagent_verify.py | SubagentStop | Reads the subagent's task and what its tools actually did. One yes/no per criterion asks whether the RECORD shows it, never whether the report claims it, plus a check for specifics the report cites that appear nowhere in the record. Zero tool calls with criteria claimed is blocked outright. An honest "not done" always passes. |
loop_detect.py | PostToolUse (any tool) | Keeps the last six tool calls per session. Only when the last three tool names repeat AND one of them failed or the same call was made twice does it ask one score: same failure again, unclear, or clear progress. Three no-progress scores in a row post a system message naming the repeated tool and the last error, and tell the model to change approach. Never blocks a tool. |
stop_selfcheck.py | Stop | Reads only the final message, the last user prompt and the tail of recent tool results. Three yes/no questions in one call: does it promise work not yet done, does it fail to answer what the user last asked, does it state an outcome the tool results do not show. Any answer at or above 0.7 sends the session back once with the check named and the offending sentence quoted. |
model_router.py | PreToolUse (Agent) | Picks the model a SUBAGENT runs on: one choice over the subagent's task routes a lookup to haiku, a read-only audit or a mechanical edit to sonnet, a change that has to iterate to green to opus and a plan or spec to fable — a task has to show it needs opus. Writes only updatedInput, never a permission. Leaves a model the caller named alone (JEV_HOOKS_ROUTER_FORCE=1 overrides). Routes only general-purpose by default (JEV_HOOKS_ROUTER_TYPES widens it): a typed agent can define its own model and a route would beat it, and a fork is never routed — it runs on its parent's model whatever its input says. When no single pick is clear but the task is plainly cheap, it still routes cheap — declining sends the spawn to the parent's model, the expensive one. Records every judged spawn — routed, declined, already there — with its description (never the prompt) and the distribution. |