A hook point of Claude Code

Stop

judged Claude Code raises Stop when the assistant is about to end its turn and hand back to you.

Here jevhooks asks Jev, a small, fast model that only picks among answers written down beforehand, whether this end fits what you asked for. If the assistant wrote “Next I will add the flag and run the tests.” and stopped there, the turn does not end: the assistant is told why and carries on. An end is left alone when the turn was already sent back once like this, or when work is still running. Two of the three checks below start in shadow, which means Jev is asked and the log records what would have been done, but the turn ends as it would have.

Say something

The jevhooks that act here

  • Send back a turn that stopped earlyStop/stopped-earlystarts on

    When a turn is about to end, Jev is asked which of five endings this is: finished, waiting on you, blocked, still running, or stopped early.

  • Send back “done” when nothing was checkedStop/unverifiedstarts in shadow

    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.

  • You write the rules in plain words, one to a line and 12 at most, in turn-rules.md beside the config file and in a project's .claude/jevhooks-turn-rules.md.

Worked cases that begin here

Each is an answer Jev could give, and the screen you would see. The rules that decide it are drawn on the page of the jevhook that acts in it.

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

The work asked for was done. The turn ends.

❯ 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

How the rules decided it, on the page of Send back “done” when nothing was checked

“Next I will add the flag and run the tests.” send it back

The assistant's last message says what it will do, has not done it, and names nothing in the way. The turn does not end: the assistant is told why and carries on.

❯ add a --json flag to the export command

● Read(src/flag.rs)
  ⎿  Read 48 lines

● Next I will add the flag and run the tests.

✻ Working…
turn end: Jev: 93% likely stopped early: work asked for is left undone and no obstacle is named · 150 ms · $0.0002   [-]
this session

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

The turn is sent back, and the assistant reads:

Jev: 93% likely stopped early: work asked for is left undone and no obstacle is named. Finish what was asked, or say plainly what is stopping you.

How the rules decided it, on the page of Send back a turn that stopped early

the end of a turn that was already sent back let it end

The turn was sent back once already. Whatever it says now, it ends, so that sending a turn back can never become a loop. Jev is not asked, so nothing is known of its answers.

❯ add a --json flag to the export command

● I have not added the flag yet: the parser has to change first.

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

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⏸ manual mode on · ? for shortcuts

How the rules decided it, on the page of Send back a turn that stopped early

an early stop, with the jevhook in shadow let it end

In shadow Jev is asked, and the log records that the turn would have been sent back. What happens is what happens with the switch off: the turn ends.

❯ add a --json flag to the export command

● Next I will add the flag and run the tests.

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

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⏸ manual mode on · ? for shortcuts

How the rules decided it, on the page of Send back a turn that stopped early

“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.

❯ 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.

How the rules decided it, on the page of Send back “done” when nothing was checked

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.

❯ 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

How the rules decided it, on the page of Send back “done” when nothing was checked

a turn that ends with no summary, when your rules ask for one send it back

You wrote “End with a one-line summary of what changed.” and the assistant's last message is only “The tests pass.” Jev is asked about each of your rules and is 94% sure this end breaks that one. The turn does not end: the assistant is given your rule and carries on.

❯ add a --json flag to the export command

● Bash(cargo test)
  ⎿  test result: ok. 41 passed; 0 failed; 0 ignored

● The tests pass.

✻ Working…
turn end: Jev: this end breaks a rule of yours (94%): "End with a one-line summary of what changed." · 150 ms ·      [-]
$0.0002 this session

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

The turn is sent back, and the assistant reads:

jevhooks: The end of this turn looks to break a rule for how one ends: the user's own rule "End with a one-line summary of what changed." (Jev: 94%). Put it right before ending, or say plainly why it does not apply. This is said once for this end.

How the rules decided it, on the page of Send a turn back when it ends against your rules

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