A jevhook

Refuse what you said not to do

You said “don’t touch the migrations”, and forty calls later the assistant edits one anyway. Switched on, this refuses that call before it runs and gives the assistant your own words as the reason. It knows only the limits you set in this session, which a second check, Remember what you said not to do, picks out of your prompts, so it has nothing to refuse until you have told the assistant not to do something.

It starts in shadow: it writes down what it would have done and changes nothing, until you switch it on. It acts at PreToolUse. It works from what another jevhook keeps: Remember what you said not to do.

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

  • Jev is asked whether the call the assistant is about to make does something you told it not to do in this session.
  • Each thing you said gets its own yes or no.
  • When Jev is 90% sure, the call is refused with your words quoted, at most 3 times in a session; after that you are asked instead.
  • It checks Bash commands and new text written to a file.

Its switch

  • At PreToolUse it is PreToolUse/forbiddenstarts in shadow
    Say something

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

[jevhooks.PreToolUse]
forbidden = "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, that the call would have been refused.

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

A command, before it runs

The rules these cases run through

Before a Bash command, a fetch or another server's tool runs, 27 rules decide what happens to it, from 33 things known about the call. The first rule whose conditions all hold decides. 16 of the things known are Jev's answers, each read against a threshold. 9 are your own switches, one for each check: a rule starts with its check's switch, so Jev is not asked about a check that is off. A few the plugin knows itself: whether the command would switch the plugin off, whether you have said what the assistant may not do, and whether a check has refused as often as one session allows. Two are the machine's: whether memory has room, measured when the first rule says to, and whether the command may still wait for it. Three rules refuse, each on an answer of 90% or more and three times a session at most. After that the rule beneath it asks you instead. The rules named “asked: …” come before the rules that ask you, and let through what you asked for in so many words.

The same rules serve act, undo, memory, leaves, argues, origin, scope, self, calls.

“leave the tests alone”, and later a command that rewrites one deny

Earlier you told the assistant to leave the tests alone, and the plugin kept your words. Jev is asked whether this command does what you ruled out, and is 94% sure it does. The command is refused, and the reason quotes you.

Jev, in one requestactonundoonmemoryonleavesonarguesonoriginonscopeonforbiddenonselfontouches jevhooksnosomething forbiddenyesleaves: refusednoorigin: refusednoforbidden: refusednoconsequential0%hard to undo1.0ordinary work100%easy to undo1.0load0.2reads a secret0%sends out0%surely reads0%surely sends0%argues0%planted0%asked for0%beyond the task0%outside project0%crosses ityesa change countsnochanges a fileroom7.8 GBpatienceleft= yesis known= yes= yes= yes= no= yes= yes= yes= no= yes= yes= yes= yes= yes= no= yes= yes= yes= yes= yes= yes= yes= yes= yes= yes= yes= yes= yes= yes= short= left= yes= yes= no= no= yes= yes&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&&look for room → measure1switches jevhooks off → askplanted by what it read → denyplanted, cap spent → askreads a secret and sends it → denyreads and sends, cap spent → askdoes what the user forbade → deny2forbidden, cap spent → askargues for itself → askasked: a consequential act → passasked: hard to put back → passasked: reads a secret → passasked: sends data out → passasked: beyond the task → passasked: outside the project → passa consequential act → askhard to put back → askreads a secret → asksends data out → askbeyond the task → askoutside the project → askno room yet → holdno room → askordinary and easily undone → allownot surely ordinary → passnot easily undone → passchanges a file → book a change

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.

❯ make the importer accept semicolons as separators

● Bash(sed -i 's/assert_eq/assert_ne/' tests/importer.rs)
  ⎿  Error: Jev: edits files in a way version control can undo (95%); undone by one command (1.0 of 3); does what the
     user said not to do (94%): "leave the tests alone"; not run

✻ Working…
command: Jev: edits files in a way version control can undo (95%); undone by one command (1.0 of 3); does what the   [-]
user said not to do (94%): "leave the tests alone"; not run · 150 ms · $0.0002 this session

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

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