A Claude Code plugin

Jev judges what Claude Code is about to do.

Claude Code runs shell commands for you and decides for itself when it has finished. jevhooks stops at those moments to ask a second opinion of something that does not write, cannot be talked round, and costs a few thousandths of a cent to ask.

That something is Jev, TypeSafe AI's System One model. It writes no text. It is handed a situation and a question whose answers are already written down, and says how likely each answer is, in about a quarter of a second.

Ordinary work just runs

Reading, building and editing run without a prompt. A band above the prompt says what Jev made of the last command, how long it took and what the session's questions have cost.

Claude Code's terminal after a command ran with no prompt. Above the prompt, a line reads: command: Jev: builds or tests; undone by one command; allowed.

Anything hard to undo is put to you

A command that deletes, rewrites history, changes the machine, sends something elsewhere or runs code nobody has read stops at a prompt, with Jev's reason in it. You decide.

Claude Code's permission dialog for git reset --hard and git clean. It carries Jev's reason: discards or rewrites version-control state; hard to undo.

Heavy commands wait their turn

Every session on the machine shares one ledger of the memory already promised to commands. Five agents starting five builds in the same second get two builds now and three in a queue, where they used to get a dead machine.

Claude Code's terminal while cargo build --release waits. The band reads: waiting for memory: needs 3.0 GB, 1.0 GB to spare.

A prompt goes to the cheapest model that will do

Switch it on and Jev scores what each prompt takes, on four levels from a lookup to open-ended work. The turn goes to the cheapest of haiku, sonnet, opus and fable that is 75% likely to be enough.

Claude Code's terminal after the prompt: What branch am I on? The band reads: prompt: Jev: a lookup; haiku.

Every picture is a real session, taken by a script in the repository. Nothing is drawn by hand.

Jev being slow, absent, unsure or broken never blocks anything. Then whatever would have happened without the plugin happens.

Every hook point, and what is done there

Claude Code raises 33 kinds of event that a plugin can answer. jevhooks is built at 7 of them. This is all of them, so you can see what is built, what is only an idea, and what nobody has thought about yet.

  • judged2 events. Built. Jev is asked, and the answer changes what happens.
  • heard5 events. Built. The plugin listens, because it needs this to judge something else.
  • idea4 for 1 of the events. Not built. An addition somebody has written down for an event; it is not a promise.
  • nothing yet26 events. Not built, and nothing is planned.

A session starts

  • Setupnothing yet
  • SessionStartnothing yet

You send a prompt

  • UserPromptSubmitheard

    The last five prompts are kept: a turn's end is judged against what you asked for. A new prompt also settles any judged command that never ran.

    idea written down for it:

    • Attach the standing rule the prompt is about, chosen from the project's own rule files.
    • Notice "note this" and remind the assistant to write the note first.
    • Notice a correction and record it, so it is not needed twice.
    • Notice a request that does not say what done looks like.
  • UserPromptExpansionnothing yet

The assistant works (the loop)

  • PreToolUsejudged

    Every Bash command that is not plainly read-only: what kind of act it is, how hard to undo, how much memory it needs. It runs, is put to you, waits for memory, or is left to your own rules.

  • PermissionRequestnothing yet
  • PermissionDeniedheard

    What became of a command Jev judged is written to the log, and the memory booked for it is given back.

  • Elicitationnothing yet
  • ElicitationResultnothing yet
  • PostToolUseheard

    What became of a command Jev judged is written to the log, and the memory booked for it is given back.

  • PostToolUseFailureheard

    What became of a command Jev judged is written to the log, and the memory booked for it is given back.

  • PostToolBatchnothing yet
  • SubagentStartnothing yet
  • SubagentStopnothing yet
  • TaskCreatednothing yet
  • TaskCompletednothing yet

The turn ends

  • Stopjudged

    Which of five endings this is: finished, waiting on you, blocked, still running, or stopped early. A confident "stopped early" sends the turn back with the reason.

  • StopFailurenothing yet

Between turns, and at the end

  • TeammateIdlenothing yet
  • PreCompactnothing yet
  • PostCompactnothing yet
  • SessionEndheard

    The session is forgotten: its prompts, its cost, and any memory still booked for it.

Whenever they happen

  • Notificationnothing yet
  • ConfigChangenothing yet
  • PreModelSwitchnothing yet
  • PostModelSwitchnothing yet
  • WorktreeCreatenothing yet
  • WorktreeRemovenothing yet
  • CwdChangednothing yet
  • FileChangednothing yet
  • DirectoryAddednothing yet
  • InstructionsLoadednothing yet
  • MessageDisplaynothing yet

Two more, outside that list

The plugin also steps in at two points of Claude Code's newer plugin interface, to choose a model. Both are built, and off unless you switch them on.

  • prompt.submitjudged

    With model choice switched on: the prompt is scored for what it takes, on four levels.

  • turn.stepjudged

    With model choice switched on: each request of the turn goes to the cheapest model that is 75% likely to be enough.

How it works

  1. A small piece of the plugin hears every event Claude Code raises. A command that plainly only reads goes no further: no question, no cost. (the hooks)
  2. Anything worth judging goes to one daemon for the whole machine, which keeps the connection to Jev warm and the key in one place. (the daemon)
  3. The daemon asks Jev three things in one request: which of eight kinds of act this is, how hard it would be to put back, and how much of the machine it takes. (the questions)
  4. Rules written in code, where a test can hold them still, turn the answers into allow, ask, wait or no opinion. Your own hooks still run, and the stricter answer wins.

Try it

With Claude Code installed, this runs the plugin's tests against a stand-in for the daemon. It needs no Rust, no Jev key and no account.

The whole repository is written as a guide in chapters: every folder says what it is and why.