A hook point of Claude Code

TaskCompleted

judged When the assistant marks a task complete, it is claiming the work is done, and jevhooks checks that claim as it checks the end of a turn: for example, files were changed and no test has passed since.

It can refuse the completion once, and the assistant reads the reason; if the assistant marks the task complete again, that goes through. When a completion goes through, jevhooks cannot add a note for the assistant to read: Claude Code takes no added text from a plugin at this point.

Say something

The jevhooks that act here

  • Refuse β€œcomplete” when nothing was checkedTaskCompleted/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.

  • Send a turn back when it ends against your rulesTaskCompleted/keptstarts in shadow

    When the assistant marks a task complete, the same rules are checked against the task as it was written down and the turn's tool calls.

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.

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.

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

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

a task marked complete with no summary, when your rules ask for one send it back

The assistant marks a task complete with β€œTask 2 is complete.” and no summary. Jev is 90% sure the rule is broken, and the completion is refused with your rule as the reason.

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

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

● Task 2 is complete.

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

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

The completion is refused, and the assistant reads:

jevhooks: The end of this task looks to break a rule for how one ends: the user's own rule "End with a one-line summary of what changed." (Jev: 90%). 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.