A hook point of Claude Code
PostToolUseFailure
judged When a tool call fails, the jevhooks plugin reads the error before the assistant does.
It can add one line beside it, such as to check what is installed after “cargo-nextest: command not found”. It cannot change the error's text, so a key in it is not masked: the assistant is told not to repeat it. Planted instructions are looked for too. What became of a call Jev judged is written to the log, and the memory booked for it is given back.
Say something
Jev is asked which of six kinds of failure this is: a missing dependency, a passing fault (one that may clear on a second try), the machine's setup, a refusal of permission, the tool called wrongly, or a real defect in the work.
Its switch is at
PostToolUse, and it acts here too. The plugin searches everything a tool returns, on your machine, for keys in 29 known formats.Its switch is at
PostToolUse, and it acts here too. Text from outside the session (a fetched page, a search, another server's tool, the output of a command that fetches, a file outside the project) is cut into blocks, one for each paragraph (a paragraph over 1,200 characters is cut again at line ends), and Jev is asked of each of the first 24 blocks: does it speak to an assistant and tell it what to do.
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.
sh: cargo-nextest: command not found missing-dependency
Jev is 90% sure a program is missing. The assistant reads one line beside the failure: check what is installed, and if something has to be installed, say which and why.
❯ run the tests ● Bash(cargo nextest run) ⎿ Error: sh: cargo-nextest: command not found ✻ Working… result: Jev: a missing dependency (90%) · 150 ms · $0.0002 this session [-] ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ❯ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ⏸ manual mode on · esc to interrupt
The assistant reads beside the failure:
jevhooks: This failure looks like a missing dependency (Jev: 90%). Check what is installed before trying again; if something has to be installed, say which and why.
How the rules decided it, on the page of Tell the assistant why a tool call failed
the same type error, for the third time again + real-bug
jevhooks has counted this failure three times this session, without asking Jev, and Jev is 95% sure it is a real defect in the work. The assistant is told both in one line: do not send the same call again, and fix the cause.
❯ make the importer return the rows it skipped ● Bash(cargo check) ⎿ Error: error[E0308]: mismatched types: expected `Vec<Row>`, found `usize` (src/importer.rs:84) ✻ Working… result: Jev: the same failure, 3 times now; a real defect in the work (95%) · 150 ms · $0.0002 this session [-] ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ❯ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ⏸ manual mode on · esc to interrupt
The assistant reads beside the failure:
jevhooks: Bash has failed this same way 3 times this session. Do not send the same call again unchanged: take another approach, or tell the user what is in the way. This failure looks like a real defect in the work (Jev: 95%). Read the error and fix its cause, not the check that reported it.
How the rules decided it, on the page of Tell the assistant why a tool call failed
an error Jev cannot place nothing told
Jev says 45% a real defect and 40% the tool called wrongly. Neither reaches 60%, and the two are not added together, so the assistant is told nothing.
❯ run the importer's own tests ● Bash(cargo test --test importer) ⎿ Error: error: no test target named `importer` ✻ Working… ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ❯ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ⏸ manual mode on · esc to interrupt
How the rules decided it, on the page of Tell the assistant why a tool call failed
a sixth failure, after the session has been told about five Jev is not asked
The assistant has already been told about five failures this session. That is the cap, so Jev is not asked and nothing is added beside the error.
❯ get the build green ● Bash(cargo build) ⎿ Error: error[E0425]: cannot find function `parse_row` in this scope (src/importer.rs:31) ✻ Working… ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ❯ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ⏸ manual mode on · esc to interrupt
How the rules decided it, on the page of Tell the assistant why a tool call failed
What this site keeps about a visit, and how to refuse it, is said in one place: what is kept.