A jevhook
Point the assistant at the right rule file
If your project keeps rule files in .claude/rules, this points the assistant at the one your prompt is about. Ask for a migration, and the assistant is told to read your rule file on migrations before it starts. You see one line above your prompt naming the file. A wrong guess costs the assistant a short file it did not need.
It is on from the start. It acts at UserPromptSubmit.
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.
- Jev is asked which of the project's own rule files (.claude/rules, sixty at most) your prompt is about, if any.
- When one file alone is at least 60% likely, the assistant is told to read it before starting and to follow it, and the file is attached to your prompt, up to 6,000 characters.
- When Jev's answer is split over several files, none is attached.
Say something
A jevhook is off, in shadow or on. To change this one, put this in ~/.config/jevhooks/config.toml:
[jevhooks.UserPromptSubmit] attach-rule = "shadow"
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 file would have been attached.
One worked case: an answer Jev could give, the rules that decide on it, and the screen you would see.
The rules these cases run through
10 rules decide what the assistant is told beside your prompt, from 15 things known. 8 are Jev's answers, from one request: a request for a note and a correction count at 80% and 80%, work with no word on what done means at 80%, long work handed over at 80%, and a rule file when it alone is 60% likely. The other 7 are known before Jev is asked: whether you have left each one switched on, and whether the project has rule files at all. No rule here decides alone. Each one that holds adds a line, and several can hold for one prompt, with two exceptions: saying what done means and asking first are one line or the other, and of the three rules about done not being said only one can hold. The assistant reads those lines beside your prompt. You do not see them; this is every word of them:
note-firstThe user is asking for something to be written down. Write the note first, where this project keeps its notes, before any other work in this request.record-correctionThe user is correcting you. Before carrying on, record what was wrong and what is right where it will be read next time (this project's memory or its rules), so the correction is not needed twice.what-done-isThis request does not say what done looks like. Before starting, state in one line what you take done to mean. Ask only if you truly cannot tell.ask-firstThis request hands you a long piece of work to do on your own, and does not say what done looks like. Before starting, ask the user what you need to know to tell finished from unfinished, and wait for the answer.heedThe user has said what you may not do, or what you now may. It is kept for this session, and tool calls are checked against it.attach-ruleThis request looks to be about one of this project's standing rules, which is attached below. Read it before starting and follow it. (Then the file.)
The same rules serve note-first, record-correction, what-done-is, ask-first, heed.
βis this ready to mergeβ, in a project with a testing.md attach-rule
Jev sees each rule file's name and opening, and is 82% sure the prompt is about testing.md. That is past the 60% one file has to reach alone, so the assistant is told to read testing.md before it starts.
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.
β― is this ready to merge β» Workingβ¦ prompt: Jev: about the rule testing.md (82%) Β· 150 ms Β· $0.0002 this session [-] ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ β― ββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ βΈ manual mode on Β· esc to interrupt
The assistant reads beside the prompt:
jevhooks: This request looks to be about one of this project's standing rules, which is attached below. Read it before starting and follow it.
What this site keeps about a visit, and how to refuse it, is said in one place: what is kept.