opencode-jev-compaction
OpenCode plugin that compacts sessions by Jev keep/drop judgments per tool call instead of LLM summaries, falling back if unhelpful.
Overview
opencode-jev-compaction replaces OpenCode's summary-based compaction with pruning judged by TypeSafe Jev. It ports fast-jev-compaction's algorithm, state fitting and fallback policy verbatim and rewrites the host integration for OpenCode's compaction hook. The transcript is sent to Jev with tool outputs replaced by size notes, and for each tool call Jev judges whether the call and its output are still needed.
Unneeded calls are removed and unneeded outputs truncated to a head plus a note that the tool can be re-run; user and assistant text is never edited, reordered or shortened. The first message and newest N messages are pinned. If Jev is unavailable, fails or cannot achieve a worthwhile reduction, the plugin declines and OpenCode uses its normal summary, so a compaction either preserves content exactly or behaves as if the plugin were absent. It installs with one command or by pasting an install prompt into OpenCode.
What the decision model decides
| Type | Question | Answers |
|---|---|---|
| Yes / no | Is this tool call still needed? | yes · no |
| Yes / no | Is this tool output still needed verbatim? | yes · no |
How it works
- On compaction, convert messages and pair tool calls with results.
- Pin the first and newest messages.
- Fit the transcript into Jev's state budget and ask per-call questions.
- Drop or truncate; fall back to the built-in summary if not worthwhile.
Strengths
- No information loss in kept content.
- Safe fallback to default behaviour.
- Proven algorithm from fast-jev-compaction.
Caveats
- Requires a TypeSafe key.
- Truncated outputs need re-running tools if needed later.
Getting started
opencode plugin add github:radqnico/opencode-jev-compaction, export TYPESAFE_API_KEY, then restart OpenCode.At a glance
- Type
- Project
- Status
- beta
- Language
- TypeScript
- Runtime
- OpenCode plugin
- Has code
- yes
Use cases and integrations
How curated lists describe it
Replaces OpenCode compaction summaries with Jev keep/drop judgments that prune stale tool calls while preserving everything kept verbatim.
yibie/awesome-jevReplaces OpenCode compaction summaries with Jev keep/drop judgments that prune stale tool calls while preserving everything kept verbatim.
cobanov/awesome-jev
Frequently asked questions
What happens if Jev fails?
The plugin declines and OpenCode falls back to its normal summary.
Is user text ever changed?
No, only tool calls and outputs are dropped or truncated.
Where does the algorithm come from?
It is ported verbatim from tamaratran/fast-jev-compaction.
Related projects
Recursive language model layer for coding agents that keeps inputs in a local evaluator, with optional Jev judge_many for typed calls.
ProjectbetaRustPre-message hook that keeps or drops SKILL.md files before the first model call, using local overlap or Jev keep/drop judgments.
HookbetaPythonOpenCode port of fast-jev-compaction that prunes stale tool calls from outgoing requests verbatim, by default only on compaction.
HookbetaTypeScriptOpenCode V2 port of fast-jev-compaction that asks Jev or a local Jev-style model which old tool outputs still matter.
ProjectprototypeTypeScriptAgent context compactor where Jev scores transcript segments to keep verbatim or move behind a recoverable pointer.
ServiceprototypePythonRAM-efficient Rust coding-agent harness, listed as using Jev decisions for memory pruning, browser navigation and voice routing.
ServiceproductionRust