fast-jev-compaction: The Context Compressor That Refuses to Summarize

A Claude Code plugin that keeps user and assistant text verbatim, uses a fast probabilistic model to prune tool history, and degrades gracefully when token budgets get tight.

8 min read • View on GitHub • More from tamaratran

A session transcript moves through a sharp paper trimmer. The user and assistant messages pass through as one continuous ribbon, while tool logs and verbose outputs are clipped into smaller fragments. The image explains the project’s main idea: preserve the exact conversation and remove only the noisy parts.
Compaction here is a verdict system, not a rewrite engine.
Key Takeaways

The best way to understand fast-jev-compaction is to start with what it refuses to do. It does not ask an LLM to retell your session. It keeps the transcript intact, then decides which tool noise can be dropped, truncated, or collapsed without changing the facts that matter.

Why summaries fail in agentic workflows

Summaries are fine for humans. They are brittle for coding agents. A summary can quietly erase the exact file path, the error string, or the one constraint that made the whole session safe.

A summary is lossy: a file path, exact error, constraint, or command can disappear even when it matters later. This library never rewrites anything. It only deletes tool calls and tool results Jev says are no longer needed, and it asks Jev while showing it the whole conversation.

Tamara Tran, Author / Maintainer · fast-jev-compaction Introduction

That is the project’s core bet. Instead of compressing meaning into a prose abstract, it keeps the original wording where fidelity matters and only removes the parts that are mechanically bulky. In a coding session, that is a very different promise.

The core idea: keep the transcript, prune the tool noise

A close-up of a three-stage mechanical gate processing a dense stack of tool inputs and outputs. The stream narrows through successive gates before exiting as a smaller but faithful session history. The image explains that the system degrades tool data in stages instead of rewriting the whole conversation.
The important move is not summarization. It is selective retention under budget.

The library’s own logic makes that distinction explicit. User and assistant messages are pinned. Tool calls and tool results are the fluid parts, the bits most likely to be trimmed when the conversation gets crowded.

if (message.type === 'user' || message.type === 'assistant') {
  keepVerbatim(message)
} else if (jevSaysDrop(message)) {
  dropOrTruncate(message)
} else {
  keepVerbatim(message)
}

How the Jev decision step works

Jev is the project’s key reversal. It is not asked to generate a summary. It is asked to make a decision. Should this tool call stay? Should its result stay verbatim? If not, how much of it is worth preserving before it becomes too large to carry?

The diagram matters because it teaches the real mental model. This is a pipeline of preservation decisions, not a summary generator.

That matters because a decision model is a better fit for this job than a prose model. A decision can be fast, cheap, and narrow. It can score relevance without inventing a new narrative.

The part that makes it production-ready: staged degradation

The clever part is not the first pass. It is what happens when the session still does not fit. The engine does not just cut from the end. It degrades in stages, squeezing the state a little harder each time.

fitState(state)
  -> truncate tool inputs
  -> abridge long text
  -> collapse older messages
  -> compact calls into one-line forms
  -> return the smallest faithful state

That sequence is what makes the tool feel engineered instead of improvised. The shape of the conversation survives even when the volume has to shrink. You still know what happened, just with less baggage.

The project’s token estimation is also pragmatic. It uses a heuristic rather than a heavyweight tokenizer, which keeps the compaction path light enough for a CLI workflow. For this use case, speed and adequate safety matter more than perfect accounting.

Claude Code integration is the hidden constraint

This is not just a library. It is a Claude Code plugin, which means it has to fit the host’s session model and hook system cleanly. The bridge code matters because it preserves original message objects when nothing changed, which reduces churn in the agent runtime.

Jev treats the state as data rather than as hostile, so text written to steer the answer can move it.

Will Kelly, Independent Developer · r/ClaudeCode Discussion

That quote points to the project’s deeper posture. It assumes the context is structured data with value, not raw prose to be rewritten. Once you adopt that stance, compaction becomes closer to filtering than writing.

What it replaces, and what it does not

ApproachWhat it changesFidelitySpeedBest forMain trade-off
Claude Code native compactionRewrites the session into a summaryMediumMediumGeneral useUseful, but lossy
RTKCompresses output before it enters contextHigh for emitted textFastTerminal-heavy workflowsOnly helps upstream data
Summarization-based memoryTurns history into prose memoryLow to mediumSlowerBroad agent memoryCan flatten technical detail
fast-jev-compactionDeletes or truncates tool noise while preserving verbatim textVery highFastTechnical agent sessionsLess narrative compression

That contrast is the headline. This project wins on fidelity because it refuses to rewrite content. It is not trying to make history prettier. It is trying to make it smaller without making it untrue.

There is also a broader pattern here. Long-context systems do not only need bigger windows. They need better memory discipline. fast-jev-compaction is a neat example of that shift: preserve the evidence, cut the noise, and never confuse compression with narration.