A jevhook

Send back “done” when nothing was checked

The assistant edits files, says “done”, and nobody ran anything. With this on, a turn that claims the work is finished when no test, build or lint has passed since the last change does not end: the assistant is told, once, to run the check or to say plainly that it is unverified. One question goes to a small model called Jev: does the last message claim the work is done? The edits and the checks are counted on your machine.

It starts in shadow: it writes down what it would have done and changes nothing, until you switch it on. It acts at SubagentStop, TaskCompleted, Stop.

Jev is the small, fast model jevhooks asks. It writes nothing: it is handed a question whose answers are already written down, and says how likely each one is, in about a quarter of a second. jevhooks is a plugin for Claude Code that asks it at the moments Claude Code lets a plugin step in, and a jevhook is one such question with what is done about the answer.

Exactly what it does

  • It acts when three things hold: the last message says the work is done, files were changed this turn, and no test, build, lint or type-check has passed since the last change.
  • Then the turn does not end: the assistant is told, once, to run the check or to say plainly that it is unverified.
  • The daemon, the plugin's own background program on your machine, counts the changes and the checks from the tool calls it judged; Jev is asked only whether the message claims the work is done, and must be 80% sure.
  • A check counts when Jev took the command for a build, test, format, lint or install, and it ran and did not fail.
  • It never acts when no file was changed, and it does not act when you said not to run things.
  • It shares one cap on how often an end is sent back with stopped-early, the jevhook that sends back a turn that stopped early.

Its switch

  • At SubagentStop it is SubagentStop/unverifiedstarts in shadow

    The subagent's last message says its work is done, it changed files, and no test, build, lint or type-check has passed since its last change. It is told, once, to run the check or to say plainly that it is unverified. Only the subagent's own changes and checks count: the tool calls whose results name that subagent. In shadow until you switch it on.

    Say something
  • At TaskCompleted it is TaskCompleted/unverifiedstarts in shadow

    Marking a task complete is the claim that it is done, so Jev is asked nothing: when files were changed and no check has passed since the last change, the completion is refused once, with what to do. In shadow until you switch it on.

    Say something
  • At Stop it is Stop/unverifiedstarts in shadow
    Say something

A jevhook is off, in shadow or on. To change this one, put this in ~/.config/jevhooks/config.toml:

[jevhooks.SubagentStop]
unverified = "on"

[jevhooks.TaskCompleted]
unverified = "on"

[jevhooks.Stop]
unverified = "on"

In shadow Jev is asked and nothing is changed. The log (jevhooks recent, or /jev in a session) then says what would have been done: for this one, that the end would have been sent back.

5 worked cases, each an answer Jev could give, the rules that decide on it, and the screen you would see. The ones you would meet most come first.

A turn, before it ends

The rules these cases run through

Before a turn ends, 15 rules decide whether it ends or goes back to the assistant with a reason. Three switches share them, and one limit on how often an end is sent back. The rules test 14 things. 4 are Jev's answers: which of five endings this is, whether the last message claims the work is done, whether you said not to run checks, and whether the end breaks one of your own rules for it. The other 10 are known before Jev is asked: the three switches, whether a limit has been reached, whether work is still running, whether there is anything to judge, whether files were changed and a check passed since, whether you forbade anything, and whether you have rules. When those settle it, Jev is not asked. The same rules judge a subagent's end and a task marked complete.

The same rules serve kept, stopped-early.

“I added the flag. All 41 tests pass.” let it end

The work asked for was done. The turn ends. This one is at Stop.

Jev, in one requeststopped-earlyonunverifiedoffkeptoffcappednostill runningnocan be judgedyesfiles changed0checked sincenouser forbadenohas rulesnostopped early3%claims donetold not to runa rule is broken= this turn= the session= a moment ago= no= no= no= yes= no= yes= yes= yes= yes= no= no= yes= yes= no= yes= yes= yes= no= yes= no= no&&&&&&&&&&&&&&&&&refused once already → let it endsent back too often → let it endsent back a moment ago → let it endswitched off → let it endpaused, not ended → let it endnothing to judge → let it endsurely stopped early → send it backdone, unchecked → send it backunchecked, may run → send it backyour rule is broken → send it backany other ending → let it end1told not to run checks → let it enddone is not claimed → let it endnot claimed, may run → let it endyour rules are kept → let it end

Open this drawing at its own size

How to read a drawing

Jev answers with numbers. What happens next is decided by a few rules, in order: of the rules that hold, the first decides. They are compiled into one small network, and these pictures are drawn from that network, not beside it, so they cannot show a rule the plugin does not have.

Read one left to right: what can be known, the tests on it, where a rule's tests meet, and the rules. Black is what a rule that holds stands on, and dashed is a test that failed. A pink rule holds; more than one can, and the numbered ones are those that decided, in order. The framed facts are Jev's, and are asked for together, in one request.

❯ add a --json flag to the export command

● I added the flag. All 41 tests pass.

✻ Worked for 3s
turn end: Jev: the turn ended as finished; 3% likely stopped early · 150 ms · $0.0002 this session                   [-]

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⏸ manual mode on · ? for shortcuts
“Done, the flag works.” after four changes and no test send it back

The daemon counted four changes to files this turn, and no check passed after the last one. Jev is asked one thing, whether the message claims the work is done, and is 96% sure. The turn is sent back: run the check, or say plainly that it is unverified. This one is at Stop.

Jev, in one requeststopped-earlyoffunverifiedonkeptoffcappednostill runningnocan be judgedyesfiles changed4checked sincenouser forbadenohas rulesnostopped earlyclaims done96%told not to runa rule is broken= this turn= the session= a moment ago= no= no= no= yes= no= yes= yes= yes= yes= no= no= yes= yes= no= yes= yes= yes= no= yes= no= no&&&&&&&&&&&&&&&&&refused once already → let it endsent back too often → let it endsent back a moment ago → let it endswitched off → let it endpaused, not ended → let it endnothing to judge → let it endsurely stopped early → send it backdone, unchecked → send it back1unchecked, may run → send it backyour rule is broken → send it backany other ending → let it endtold not to run checks → let it enddone is not claimed → let it endnot claimed, may run → let it endyour rules are kept → let it end

Open this drawing at its own size

❯ add a --json flag to the export command

● Update(src/flag.rs)
  ⎿  Updated src/flag.rs with 12 additions and 2 removals

● Done, the flag works.

✻ Working…
turn end: Jev: the last message claims the work is done (96%), and no check has passed since the last of 4 changes · [-]
150 ms · $0.0002 this session

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⏸ manual mode on · esc to interrupt

The turn is sent back, and the assistant reads:

jevhooks: The last message says the work is done, but this turn made 4 changes to files and no test, build, lint or type-check has passed since the last one (Jev: 96% that done is claimed). Run the check that covers the change, or say plainly that it is unverified. This is said once.
the same message, after the tests passed nothing more to do

A check ran and passed after the last change. The daemon knows that, and it is enough to rule out sending the turn back, so Jev is not asked whether done was claimed. No rule decides, and the turn ends as it would have. This one is at Stop.

Jev, in one requeststopped-earlyoffunverifiedonkeptoffcappednostill runningnocan be judgedyesfiles changed4checked sinceyesuser forbadenohas rulesnostopped earlyclaims donetold not to runa rule is broken= this turn= the session= a moment ago= no= no= no= yes= no= yes= yes= yes= yes= no= no= yes= yes= no= yes= yes= yes= no= yes= no= no&&&&&&&&&&&&&&&&&refused once already → let it endsent back too often → let it endsent back a moment ago → let it endswitched off → let it endpaused, not ended → let it endnothing to judge → let it endsurely stopped early → send it backdone, unchecked → send it backunchecked, may run → send it backyour rule is broken → send it backany other ending → let it endtold not to run checks → let it enddone is not claimed → let it endnot claimed, may run → let it endyour rules are kept → let it end

Open this drawing at its own size

❯ add a --json flag to the export command

● Done, the flag works.

✻ Worked for 3s
turn end: Jev: nothing to say of this end · 150 ms · $0.0002 this session                                            [-]

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⏸ manual mode on · ? for shortcuts
a task marked complete after four changes and no test send it back

Marking a task complete is the claim that it is done, so that fact is known without asking. With changes and no check since, the completion is refused on what the daemon knows alone: Jev is asked nothing. This one is at TaskCompleted.

Jev, in one requeststopped-earlyoffunverifiedonkeptoffcappednostill runningnocan be judgedyesfiles changed4checked sincenouser forbadenohas rulesnostopped earlyclaims doneyestold not to runa rule is broken= this turn= the session= a moment ago= no= no= no= yes= no= yes= yes= yes= yes= no= no= yes= yes= no= yes= yes= yes= no= yes= no= no&&&&&&&&&&&&&&&&&refused once already → let it endsent back too often → let it endsent back a moment ago → let it endswitched off → let it endpaused, not ended → let it endnothing to judge → let it endsurely stopped early → send it backdone, unchecked → send it back1unchecked, may run → send it backyour rule is broken → send it backany other ending → let it endtold not to run checks → let it enddone is not claimed → let it endnot claimed, may run → let it endyour rules are kept → let it end

Open this drawing at its own size

❯ work through the three tasks for the --json flag

● Update(src/flag.rs)
  ⎿  Updated src/flag.rs with 12 additions and 2 removals

● Task 2 is complete: the flag is parsed.

✻ Working…
task: jevhooks: the task is marked complete, and no check has passed since the last of 4 changes · 150 ms · $0.0002  [-]
this session

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⏸ manual mode on · esc to interrupt

The completion is refused, and the assistant reads:

jevhooks: The task is marked complete, but this task made 4 changes to files and no test, build, lint or type-check has passed since the last one. Run the check that covers the change, or say plainly that it is unverified. This is said once.
a subagent that reports “Renamed everywhere, all good.” after four changes and no test send it back

A subagent's end is an end too, judged by the same rules with its own calls counted: four changes to files, and no check passed after the last. Jev is 95% sure its report claims the work is done. The subagent is sent back before its report reaches the assistant that started it.

Jev, in one requeststopped-earlyoffunverifiedonkeptoffcappednostill runningnocan be judgedyesfiles changed4checked sincenouser forbadenohas rulesnostopped earlyclaims done95%told not to runa rule is broken= this turn= the session= a moment ago= no= no= no= yes= no= yes= yes= yes= yes= no= no= yes= yes= no= yes= yes= yes= no= yes= no= no&&&&&&&&&&&&&&&&&refused once already → let it endsent back too often → let it endsent back a moment ago → let it endswitched off → let it endpaused, not ended → let it endnothing to judge → let it endsurely stopped early → send it backdone, unchecked → send it back1unchecked, may run → send it backyour rule is broken → send it backany other ending → let it endtold not to run checks → let it enddone is not claimed → let it endnot claimed, may run → let it endyour rules are kept → let it end

Open this drawing at its own size

❯ rename Client to HttpClient everywhere

● Update(src/http.rs)
  ⎿  Updated src/http.rs with 6 additions and 6 removals

● Renamed everywhere, all good.

✻ Working…
subagent end: Jev: the last message claims the work is done (95%), and no check has passed since the last of 4       [-]
changes · 150 ms · $0.0002 this session

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⏸ manual mode on · esc to interrupt

The subagent's end is sent back, and it reads:

jevhooks: The last message says the work is done, but this subagent's work made 4 changes to files and no test, build, lint or type-check has passed since the last one (Jev: 95% that done is claimed). Run the check that covers the change, or say plainly that it is unverified. This is said once.

What this site keeps about a visit, and how to refuse it, is said in one place: what is kept.