jev-compaction
Agent context compactor where Jev scores transcript segments to keep verbatim or move behind a recoverable pointer.
Overview
jev-compaction is a Python library (jevctx) plus HTTP sidecar that decides what a coding agent keeps in its context. Jev only scores text and never writes it, so everything the agent sees is original and anything moved out can be restored byte for byte through an expand call. This avoids two problems of LLM summarisation: invented details and broken prompt caches.
Tool output is split into segments, and one Jev request asks each segment whether to keep it, its type, its role, how long it will matter, and whether it is a prompt injection. Low-value runs become one-line pointers, injections are quarantined, and a recall function lets Jev rerank earlier output from a loose description. Supersession is detected from tool arguments without a Jev call, and the transcript keeps an append-only frozen prefix so the prompt cache stays valid. An OpenCode plugin uses the sidecar, and an offline demo runs without an API key.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Yes / no | Should this segment stay in context? | — |
| Choice | What type and role does this segment have? | source · test output · traceback · code to change · evidence · navigation · noise |
| Yes / no | Is this segment a prompt injection? | — |
How it works
- Split each tool output into segments
- One Jev request profiles every segment: keep, type, role, lifetime, injection
- Keep high-value segments verbatim; replace low-value runs with a pointer and quarantine injections
- Restore with expand or recall; keep the cached prefix append-only
Strengths
- No invented facts, since kept lines are originals
- Moved content is recoverable byte for byte
- Prompt cache survives because the prefix only grows
Caveats
- Integration beyond the OpenCode plugin needs the HTTP sidecar
- Live use needs a Jev key; only the demo is offline
Getting started
Clone the repo, run `uv venv .venv && uv pip install --python .venv/bin/python -e '.[dev]'`, then `.venv/bin/python demo.py` (no API key needed).At a glance
- Type
- Service
- Status
- prototype
- Language
- Python
- Runtime
- Library and HTTP sidecar; OpenCode plugin
- Has code
- yes
- Has tests
- yes
- License
- MIT
Use cases and integrations
How curated lists describe it
Context management: standalone agent context compactor where Jev only scores transcript segments — kept lines stay verbatim, low scorers move to a store behind an expand() pointer instead of being deleted, and the append-only frozen prefix keeps the prompt cache valid; runnable offline demo, no API key needed.
yibie/awesome-jevA context compactor that can only score, never write — so an agent's memory can't hold a fact the transcript never contained. Working demo, runs offline.
logicrw/awesome-jev-projectsA context compactor that can only score, never write — so an agent's memory can't hold a fact the transcript never contained. Working demo, runs offline.
hellogumbo/awesome-jev
Frequently asked questions
What does Jev decide?
For each segment of tool output: whether to keep it, its type and role, how long it matters, and whether it is an injection.
How is this different from LLM summarisation?
Nothing is rewritten, so no facts are invented, moved text is recoverable, and the prompt cache is preserved.
Can I try it without a key?
Yes, the local demo runs offline.
Related projects
- fast-jev-compaction★ 7,616
Claude Code plugin and npm library that replaces the compaction summary with Jev keep, truncate or drop scores for every tool call.
PluginbetaTypeScript Codex plugin that builds handoff packets by asking Jev whether each old read-only tool record should stay, keeping retained text verbatim.
ProjectbetaJavaScriptCursor CLI plugin that asks Jev keep-or-drop nouls for each tool call and result, then re-injects kept facts after compaction.
CLIbetaTypeScriptDeepSeek Harness plugin that asks Jev which tool results can be pruned early, delaying or avoiding lossy compaction.
ProjectbetaTypeScriptDeepSeek Harness compaction backend that asks Jev which tool calls and outputs to keep, preserving everything else verbatim.
ProjectbetaJavaScriptDeepSeek Harness compaction plugin where Jev decides which tool results are still needed and code writes deterministic receipts.
ProjectbetaTypeScript