fast-jev / opencode

Keep the context.
Not the clutter.

Context compaction that makes decisions,
not new summaries.

JEV classifies old tool calls and results. Useful history stays in its own words; what can be re-read or re-run can go.

opencode plugin add github:overbit/fast-jev-compaction-opencode

Experimental Conservative by default. Native compaction remains the fallback.

session / context reviewIllustrative example
Before compaction
01
User request Pinned“Fix the authentication test.”
02
glob("src/**/*.ts") Drop48 paths · can be searched again
03
read("src/auth.ts") KeepRelevant implementation · verbatim
04
read("package.json") TruncateCall + output · full contents not needed
05
read("docs/old-api.md") DropStale reference · can be re-read
06
Recent test failure PinnedExpected 200, received 401
Classify, don’t summarize.Protect recent work.Hosted or local.

A smaller history.
The same retained words.

Source reads, searches, and build logs can outlive their usefulness. Rather than rewrite the conversation, the plugin asks two specific questions about each eligible completed tool call.

Call retention

Does knowing this call was made still matter?

JEV evaluates the tool call and input in the surrounding conversation.

Result retention

Is the full output still needed verbatim?

Large outputs are represented by bounded notes in the decision prompt.

What the decision means, at the default threshold of 0.5
Classifier decisionCheckpoint outcomeWhat changes
Full result meets thresholdKeepCall and full result stay.
Only the call meets thresholdTruncateCall stays; result is shortened.
Neither meets thresholdDropCall and result are removed.
First or recent messagePinnedAlways retained; not a candidate.

No useful decision? Keep the safety net.

Unanswered calls default to keep. Classifier errors or a reduction below the configured minimum leave OpenCode’s native compaction available. With few completed tool calls, there may be little to remove.

From install
to your next session.

Add the plugin, then choose where decisions run. The hosted backend needs an API key. The supported local path needs a compatible decision model with probability output.

1Add the plugin

Run this in your terminal for OpenCode V2.

Terminal
opencode plugin add github:overbit/fast-jev-compaction-opencode

The package provides both ./server and ./tui entrypoints.

2Choose your backend

Hosted TypeSafe JEV

The default backend. Set your API key; no plugin options are required.

Terminal
export TYPESAFE_API_KEY=...

Default model: jev-latest. Keep credentials out of committed configuration.

Local LM Studio

Load the supported Jev-Style Qwen3.5 2B v1 decision model, then set backend to local.

opencode.json
{
  "$schema": "https://opencode.ai/config.json",
  "plugins": [{
    "package": "github:overbit/fast-jev-compaction-opencode",
    "options": {
      "backend": "local"
    }
  }]
}

Default endpoint: http://127.0.0.1:1234/v1
Model: jev-style-qwen3.5-2b-decision-mlx

Requires logprobs and top_logprobs. Ordinary generated prose is not enough. Jev-Style 0.8B v3 is not directly supported by this adapter.

Conservative settings.
Explicit limits.

The plugin supplies a deterministic checkpoint string through OpenCode V2’s compaction hook. Retained text is not model-rewritten, but the original message structure is flattened.

This is an experimental port, not an arbitrary replacement-message API.

Explore all configuration options
Recent messages pinned
6 preserveRecentMessages
Keep threshold
0.5 keepThreshold
Minimum reduction
25% minReductionRatio
Truncated result head
300 chars truncateHeadChars

When something doesn’t compact.

No request reaches the local model

A classification request needs at least one completed tool call outside the pinned recent-message window. Short sessions may correctly send no request. Check the diagnostic log for candidate counts before changing your configuration.

The local classifier falls back

Check that the endpoint is reachable, the loaded context is large enough, and the model exposes logprobs and top_logprobs. Every compaction writes an outcome reason to ~/.local/share/opencode/log/fast-jev-compaction.log.

See diagnostic reasons and smoke-test configuration
Can I use the smaller 0.8B v3 model?

Not through this plugin’s current local adapter. The v3 model needs its dedicated scoring runtime / System One-compatible API, which is not directly wired into this plugin yet.

Read the model compatibility notes

Keep what matters.
Inspect how it works.

Explore the source