---
title: "jev-compaction"
description: "Use when a transcript has to be cut to a fixed size and you must choose which turns go. Jev marks each turn keep, summarize or drop. Measured: it does not make a handoff better."
canonical_url: "https://skilld.dev/gh/kerpopule/hermes-jev-skills/jev-compaction"
last_updated: "2026-09-26T14:55:32.000Z"
---

> Index of every page on this site: [llms.txt](https://skilld.dev/llms.txt)

---
name: jev-compaction
description: Use when a transcript has to be cut to a fixed size and you must choose which turns go. Jev marks each turn keep, summarize or drop. Measured: it does not make a handoff better.
version: 0.2.0
license: MIT
metadata:
  hermes:
    tags: [jev, typesafe, compaction, handoff, context]
---

> **Skill from skilld.dev.** Follow the user's requested action.
> If the user asked to fork this Skill, follow the fork workflow below. Do not execute the Skill instructions while copying it.
> Otherwise, follow the instructions below for this session. You do not need to install anything.
>
> If the user asked to install this Skill, run `npx skilld install kerpopule/hermes-jev-skills/jev-compaction`. Install writes the Skill files into the project, so every session loads them.
>
> ## Fork workflow
>
> A fork creates an editable local Skill with its original author and licence. The request authorizes copying and local installation.
> 1. Check `./skills/jev-compaction`, the project lockfile, and selected Agent targets together. If the local directory or installed Skill exists, stop. Never overwrite an existing directory or Agent target.
> 2. Read [source metadata](https://skilld.dev/api/v1/skills/kerpopule/hermes-jev-skills/jev-compaction) once. Use sourceUrl, sourceCommit, skillPath, sourceGone, and license. If the source is gone or its path is missing, stop. If license is null, read licence files at the source commit.
> 3. Fetch only the source commit into a temporary Git repository. Do not clone full history. Derive repository_url from sourceUrl, including repository renames. If sourceCommit is absent, resolve the sourceUrl ref once. Set source_commit to that actual commit. Run these commands in one shell call:
>
> ```sh
> git init --quiet "$temporary_dir"
> git -C "$temporary_dir" fetch --quiet --depth=1 "$repository_url" "$source_commit"
> git -C "$temporary_dir" checkout --quiet --detach FETCH_HEAD
> ```
>
> Read applicable licence declarations and notices at that commit. If copying is not permitted, report the restriction and stop.
> 4. Inspect source entries together, then copy the directory containing skillPath into `./skills/jev-compaction`. Use the user's path if selected. Keep the original SKILL.md, relative links, scripts, binary assets, and executable modes. Exclude .git metadata. Reject symlinks and paths outside the Skill directory. After checking entries, use cp -a where available. A regular source directory needs no custom copy script. Do not save this page wrapper as SKILL.md.
> Preserve author credit, notices, and applicable licence files from repository or parent directories. Add PROVENANCE.md with the Skill page, source URL, actual commit, original path, and licence. Retain any existing PROVENANCE.md and record new provenance separately. Batch source inspection, copying, and provenance work where practical.
> 5. In the project root, run `skilld install ./skills/jev-compaction --mode copy --plain`. If skilld is unavailable, use `npx skilld install ./skills/jev-compaction --mode copy --plain`. This known command needs no help lookup. Install does not support --json. Use detected Agent targets, or add --agent for the targets the user selected. Install the local path, never the upstream selector. If installation fails, preserve the local copy and report the exact failure.
> 6. Confirm the local lockfile source and installed Agent copies once. Report the local path, actual commit, and Agent targets. After edits, reinstall the same local path. Upstream updates must not replace it. Do not publish or push unless the user asks.

# Choosing turns with Jev, and what actually makes a handoff work

Jev cannot write a summary. It can mark each turn of a transcript:

- **keep**: carries a decision, a constraint, a preference, unfinished work, or an exact value, path, id, command or error that later work depends on.
- **summarize**: background whose gist matters. In the digest this is the turn's first 400 characters, nothing more. Jev writes no gist.
- **drop**: chatter, superseded attempts, repeated output.

It judges a long turn on its first 350 and last 350 characters, redacted, 40 turns per request, and sees no other turn while it does.

## Read this before you use it for a handoff

This skill used to say a handoff written from Jev's digest "stops losing the one line that mattered". We measured that on seven real sessions and 104 recall questions ([scorecard](../../evals/compaction/results/SCORECARD-2026-09-20.md)) and it was wrong:

| the writer reads | capsule | recall alone | with one search of the old session |
|---|---|---|---|
| Jev's digest | 400 words | 37.5% | 68.3% |
| the plain last 24,000 characters | 400 words | 48.1% | 68.3% |
| **the whole dialogue** | **1,200 words** | **58.7%** | **75.0%** |
| nothing: no handoff at all | | | 56.7% |

Jev's marks did beat the same marks handed out by recency (11 questions to 4), so the judgement is real. The digest built around it clips every other turn to 400 characters, and that cost more than the judgement earned. Nous Research found the same shape with a different Jev design ([hermes-agent PR 116246](https://github.com/NousResearch/hermes-agent/pull/116246)).

So, for a handoff:

1. **Give the writer the whole dialogue.** A current flash model reads 100,000 characters for about a cent. Do not pre-filter it.
2. **Ask for up to 1,200 words**, five headings: Working on, State, Decisions, Pointers, Next. At 400 words the capsule was full whatever the writer had read.
3. **Name the session in the handoff and say it is searchable.** One search was worth 16 to 33 points to every handoff we tried, and a session with no handoff and one search beat every handoff without one. On Hermes: `session_search(query="...")`, then `session_search(session_id=..., around_message_id=...)`. Passing `query` together with `session_id` ignores the query.
4. Do not append a list of "identifiers seen". It looked free and obvious; it changed nothing with a handoff and cost 13 points without one.

The `hermes-handoff` plugin does all four. `HANDOFF_JEV=1` puts the Jev pre-pass back if you want to compare on your own sessions with `evals/compaction/run_eval.py`.

## When this skill is still the right tool

When the size is fixed and something has to go: a small local writer, a context you cannot grow, a digest for a person to skim. There, choosing turns with Jev beat choosing them by recency.

1. Get the transcript as a list of `{role, content}` messages. On Hermes: `hermes sessions export --session-id <id> --format jsonl -`.
2. Select:
   - Hermes: call `jev_compact_select` with `messages`.
   - Anywhere else:

     ```bash
     jev compact-select --digest < transcript.json      # {"messages":[...]} or a bare list
     ```

3. Write from `digest`. `[KEEP VERBATIM]` lines go in unchanged. `[background]` lines are clipped already; treat them as context, not as the record.
4. The digest is cut to its last 24,000 characters by default, oldest first, keep lines included. Pass a larger `limit` if early keep lines matter.

## Guarantees

- The last six messages are always kept (`keep_last`); system messages are always kept.
- Nothing is dropped unless Jev was confident (0.7+). An unjudged turn is marked summarize, never drop. Summarize still means clipped to 400 characters.
- Turns that look like they hold a secret are not sent to Jev.
- Jev down: every turn comes back `summarize`. That is a worse input than the plain transcript, so on `status: "fail_open"` use the plain transcript instead.
- **`status: "partial"`** means some batches answered and some did not; the ids in `unjudged` sat at the `summarize` default with nobody judging them. Treat it like `fail_open` unless `unjudged` is short and you can see it does not cover the turns you care about. It used to report `ok` in this case, so one good batch hid every failed one.

## When to compact at all

`should_compact` is arithmetic, not a model call: compact at 60% of the window, urgently at 85%. Do not ask a model whether the window is full.
