A jevhook

Carry your instructions across a compaction

When a conversation grows long, Claude Code replaces it with a summary, and a rule you gave early (“never push without asking”) can be lost or reworded. Before that happens Jev, the small model this plugin asks, picks out which of your prompts still say how the assistant is to work, and the plugin carries those across in your own words. The assistant reads them again when the session goes on.

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

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

  • Before Claude Code replaces a conversation with its summary, the plugin asks Jev about each of your latest prompts (twelve at most, and whatever the last compaction carried): does it still say how the assistant is to work, as something it must not do, something it must always do, or a standing go-ahead? A prompt Jev is 70% sure of is carried across in your own words: the writer of the summary is told to keep it, and the assistant reads it again when the session starts after the compaction.
  • The plugin stores your prompts for this on your own machine, with secrets masked, so a session you resume still has them.

Its switch

  • At session.compact it is session.compact/standingstarts in shadow
    Say something

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

[jevhooks.session.compact]
standing = "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 of your words would have been carried across.

5 worked cases, each an answer Jev could give, the rules that decide on it, and the screen you would see. The ones you would meet most come first, and the 3 at the edges last: a switch that is off, a cap that is spent, an answer Jev is not sure of.

A conversation, before it is compacted

The rules these cases run through

2 rules decide what is carried across a compaction and what its summary leaves out, from 6 things known. 2 are Jev's answers, a yes or no for every message or result asked about, read one by one and never as a sum: whether one of your latest 12 prompts still says how the assistant is to work (carried across at 70%), and whether one long result of an older call is no longer needed (left out at 25% or under). The rest are the two switches and whether there is anything to ask about, known before Jev is asked. Neither rule refuses anything or sends anything back. Both can hold for one compaction, and nothing here has a limit. A result that is left out keeps its call, and the summary's writer is told how to read the line that stands in its place.

The same rules serve trimmed.

“never push without asking me first”, between two requests for work standing

Jev is 93% sure the second message still says how the assistant is to work, and does not say so of either request. So that message is carried across in your words: the writer of the summary is told to keep it, and the assistant reads it again after the summary.

Jev, in one requeststandingontrimmedonhas messagesyeshas long resultsnoone still holds93%one is not needed= yes= yes= yes= yes= yes= yes&&&&an instruction still holds → carry1a result is not needed → leave out

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.

❯ add a --json flag to the export command

● The flag is added and the tests pass. Nothing is pushed.

✻ Worked for 3s
compaction: Jev: 1 of your instructions carried across the compaction (93%) · 150 ms · $0.0002 this session          [-]

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⏸ manual mode on · ? for shortcuts

The summary's writer is told:

The user gave the instructions quoted below during this conversation, and they still hold. Keep every one of them in the summary, in the user's own words, under a heading of their own:
- "never push without asking me first"
the session starting again after that compaction standing

A summary has replaced the conversation, and what you said is in it only as its writer put it. So the daemon's answer at the compaction is kept until the session starts again, and the assistant reads your own words then, once. This one is at SessionStart.

Jev, in one requeststandingontrimmedonhas messagesyeshas long resultsnoone still holds93%one is not needed= yes= yes= yes= yes= yes= yes&&&&an instruction still holds → carry1a result is not needed → leave out

Open this drawing at its own size

❯ add a --json flag to the export command

● The flag is added and the tests pass. Nothing is pushed.

✻ Worked for 3s
compaction: Jev: 1 of your instructions carried across the compaction (93%) · 150 ms · $0.0002 this session          [-]

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⏸ manual mode on · ? for shortcuts

The assistant reads as the session starts again:

jevhooks: This conversation was just compacted. Before it was, the user said what is quoted below, and it still holds. Go by it as you would if it stood above in full:
- "never push without asking me first" (Jev: 93%)
a message that may be an instruction, and a result that may be needed nothing changed

Jev is 50% sure the message still holds and 40% sure the result is needed. When Jev is in doubt nothing is carried and the result stays: neither rule holds, and the compaction goes on as it would have without the plugin.

Jev, in one requeststandingontrimmedonhas messagesyeshas long resultsyesone still holds50%one is not needed40%= yes= yes= yes= yes= yes= yes&&&&an instruction still holds → carrya result is not needed → leave out

Open this drawing at its own size

❯ try to keep the diffs small if you can

● Understood. The last change touched two files.

✻ Worked for 3s

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⏸ manual mode on · ? for shortcuts
the first two together, with the switches as the plugin is first installed nothing changed

Both switches start in shadow, so Jev is asked and the log records that an instruction would have been carried and a result left out. The same answers are then read again as if both switches were off, and that reading is the one acted on: nothing is changed.

Jev, in one requeststandingofftrimmedoffhas messagesyeshas long resultsyesone still holds93%one is not needed12%= yes= yes= yes= yes= yes= yes&&&&an instruction still holds → carrya result is not needed → leave out

Open this drawing at its own size

❯ add a --json flag to the export command

● The flag is added and the tests pass. Nothing is pushed.

✻ Worked for 3s

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⏸ manual mode on · ? for shortcuts
a session with none of your prompts stored and no long result of an older call Jev is not asked

Each rule tests its switch first, then whether there is anything to ask about. With none of your prompts stored and no long result, both rules have failed before any question is sent, so Jev is not asked.

Jev, in one requeststandingontrimmedonhas messagesnohas long resultsnoone still holdsone is not needed= yes= yes= yes= yes= yes= yes&&&&an instruction still holds → carrya result is not needed → leave out

Open this drawing at its own size

❯ what branch am I on

● You are on feature.

✻ Worked for 3s

────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
❯
────────────────────────────────────────────────────────────────────────────────────────────────────────────────────────
  ⏸ manual mode on · ? for shortcuts

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