A jevhook

Leave out what a long output does not need

A build log thousands of lines long fills the conversation with lines nobody needs. This trims a long tool output before the assistant reads it: the parts your request does not need are left out, with a line where each was. Nothing is lost: the whole output is saved to a file the assistant is told about, and a part that mentions a failure always stays.

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

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

  • A tool output over 12,000 characters (a number you can set) is cut into blocks of about a paragraph, and Jev is asked of each one: does the assistant need this for what you asked? A block is left out when Jev says it is 10% likely or less to be needed, and a line is left in its place.
  • The first block, the last block and any block that mentions a failure always stay, and so does any block Jev is unsure of or gives no answer for.
  • Before anything is left out, the whole output is saved, with any secrets in it masked, to a file on your machine that the assistant is told about and that is removed when the session ends.
  • The contents of a file the assistant reads, and the output of a call that failed, are never shortened.

Its switch

  • At PostToolUse it is PostToolUse/prunedstarts in shadow
    Say something

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

[jevhooks.PostToolUse]
pruned = "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, which blocks would have been left out.

One worked case: an answer Jev could give, the rules that decide on it, and the screen you would see.

What a tool brought back, before the assistant reads it

The rules these cases run through

8 rules decide what is done to a tool's result before the assistant reads it, for three switches, and one result can set off all three. They test 11 things. 2 are Jev's answers, a yes or no for every block (a paragraph, or 1200 characters of a longer one), the first 24 at most, read block by block and never as a sum: whether a block tells an assistant what to do (pointed out at 60%, withheld at 90%), and whether a block is not needed (left out at 10% or under). A key in a known format needs no answer. No rule here decides alone: every rule that holds is acted on. Withholding happens 3 times a session at most, and after that the rule beneath it points the block out instead. One rule has the whole output kept in a file before the next may leave anything out. What a failed call says cannot be replaced, so for one the rules only tell.

The same rules serve leaked, injected.

the long output of a build that passed leave-out

Jev says two blocks of compile log are 2% and 5% likely to be needed, under the 10% at which a block is left out. The whole output is saved to a file first. Then the two blocks are left out, each place is marked, and the assistant is told where the whole output is.

Jev, in one requestleakedoninjectedonprunedonfrom outsidenoa known keynolongyescan be replacedyesinjected: withheldnoinstructsa block not needed2%the whole is keptyes= yes= yes= yes= no= yes= yes= no= surely= yes= likely= yes= yes= yes= yes&&&&&&&&&&&&&&&&a key in a result → mask ita key in a failure → tellsurely instructions → withholdinstructions, cap spent → point outa failure instructs → point outlikely instructions → point outkeep the whole output → keep it1more than is needed → leave out2

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.

❯ build it and tell me if anything warns

● Bash(cargo build)
  ⎿  Finished `dev` profile [unoptimized + debuginfo] target(s) in 48.20s

✻ Working…
result: Jev: 2 of 8 blocks left out as not needed · 150 ms · $0.0002 this session                                    [-]

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

The assistant reads beside the result:

jevhooks: This output was long, and 2 of its 8 blocks were left out as not needed for the current request (each place is marked). The whole output, with secrets masked, is in a file. Read it there if you need what was left out.

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