A point of the newer plugin interface
session.compact
judged Before Claude Code compacts a long conversation into a summary, Jev, a small, fast model, is asked which of your instructions still hold (“never push without asking me first”) and which long results of older calls the work no longer needs.
The first are carried across in your words, and the second are left out.
Claude Code's list of hook events does not have this one: it belongs to the newer plugin interface the plugin is written against.
Say something
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.
Without this, whatever writes the summary reads every long listing and build log of the session.
Each is an answer Jev could give, and the screen you would see. The rules that decide it are drawn on the page of the jevhook that acts in it.
“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.
❯ 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"
How the rules decided it, on the page of Carry your instructions across a compaction
a finished build's 40,000 characters, and the file the work is about trimmed
Jev says the build's output is 12% likely to be needed and the file 77%. Each result is judged by itself, never as a sum, so only the build's output is left out: a line stands in its place, and the call stays.
❯ fix the off-by-one in the parser ● The off-by-one is fixed in src/parser.rs, and the build passes. ✻ Worked for 3s compaction: Jev: 1 results no longer needed left out of it (40000 characters) · 150 ms · $0.0002 this session [-] ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ❯ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ⏸ manual mode on · ? for shortcuts
The summary's writer is told:
In this conversation the result of 1 tool call has been replaced by a line that begins "[jevhooks:". The assistant read each of those results in full when it made the call, and what it did and concluded from them stands: do not describe that work as unsupported or unverified, and do not quote or mention the replacement lines in the summary.
In place of a result:
[jevhooks: what this call brought back (40000 characters) was read at the time and left out when the conversation was compacted. The work in hand no longer needs it (Jev: 12% likely needed). Make the call again if it does.]
How the rules decided it, on the page of Drop old results from a compaction
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.
❯ try to keep the diffs small if you can ● Understood. The last change touched two files. ✻ Worked for 3s ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ❯ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ⏸ manual mode on · ? for shortcuts
How the rules decided it, on the page of Carry your instructions across a compaction
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.
❯ 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
How the rules decided it, on the page of Carry your instructions across a compaction
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.
❯ what branch am I on ● You are on feature. ✻ Worked for 3s ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ❯ ──────────────────────────────────────────────────────────────────────────────────────────────────────────────────────── ⏸ manual mode on · ? for shortcuts
How the rules decided it, on the page of Carry your instructions across a compaction
What this site keeps about a visit, and how to refuse it, is said in one place: what is kept.