Teknium reports Jev compaction can increase token costs
Teknium’s public evaluation says a Jev compaction strategy removes tool calls and eventually stops yielding savings. Repeated compaction can invalidate caches and increase total token costs, according to the critique.

TL;DR
- The viral plugin replaces Claude Code's summary with per-tool-call retention decisions, as altryne's demo claimed after shrinking a nearly 1M-token session to 86K in about a second.
- Teknium's public harness put a summary-plus-search baseline at 79% recall and 55K retained tokens, versus 76% and 115K for the tested Jev strategy, according to Teknium's evaluation; its worked sequence also found that the removable pool shrinks each cycle in Teknium's worked sequence.
- Historical transcript edits can invalidate a prompt-cache prefix, the cost mechanism detailed by theo's critique.
- A separate plugin uses Jev to classify safe task boundaries before calling compaction, according to compact-adviser's launch.
The fast-jev-compaction README says it scores every tool call and result in one Jev request. Jev itself was launched as a structured-decision model rather than a text generator in TypeSafe's announcement. OpenAI's compaction guide takes another route, carrying an encrypted compaction item into subsequent turns.
The filter
The demo's before-and-after panels measured context occupancy, not an end-to-end task benchmark. Altryne later said the post-compaction session felt “a tiny tiny bit” dumber, and that the test covered one thread in altryne's follow-up.
The repository README describes this sequence:
- Pair each tool use with its result by
tool_use_id, while pinning initial and explicitly preserved messages. - Build a representation of the conversation, staging it down to
maxStateTokens, 25K by default. - Ask Jev whether to retain a call and whether to retain its result verbatim.
- Keep both, truncate a result, or remove the pair according to a threshold. User and assistant text remains verbatim and in order.
That design explains both the appeal and the dispute. It preserves exact file paths, errors, commands, and constraints when retained, but it makes a relevance decision over individual tool interactions rather than rewriting a durable compact state.
The public evaluation
Teknium said the linked Hermes Agent harness is reproducible and targets this strategy rather than Jev generally.
The chart reports four distinct tradeoffs for the tested configuration:
- Recall: summary plus
session_searchreached 79% at 55K tokens; Jev pruning reached 76% at 115K. - Retained context: 115K versus 55K meant 2.1 times as much context billed on every later turn.
- One compaction pass: Jev took 1.4 seconds and cost $0.007; the summary took 37 seconds and $0.061.
- Repeated cycles: space freed fell from 63% to 8%; the chart says a 200K-token host became stuck after 0.42M total tokens, and a 32K state cap failed beyond roughly 500 tool calls.
The low one-shot latency is real in the reported numbers. The evaluation's argument is that persistent-token and cache costs dominate that one-shot advantage over a long agentic run.
The shrinking floor
Tool-result pruning has a finite reservoir. In Teknium's worked sequence, a session at 500K removes 250K tool-call tokens and falls to 250K; after refilling to 500K, it can remove only 125K, then 75K after beginning the next cycle at 375K.
User and assistant messages remain, so the strategy eventually retains a large transcript with progressively fewer removable tool tokens. Teknium also warned that cutting interactions without enough trajectory context can leave the next agent confused in Teknium's reply.
Kunchenguid made the same structural objection: preserving user and assistant messages forever means the transcript keeps growing, so a long run can exhaust the window without a recovery step that replaces the old state.
Prompt cache
The cache objection is about where a history edit occurs, not simply how many tokens disappear. Theo illustrated it as deleting item 2 from a cached 1, 2, 3, 4, 5, 6 history, which requires rewriting items 3 through 6 in theo's critique.
Claude Code's documentation map lists conversation compaction among actions that invalidate its cache. Zeeg added that a partial filter retaining 80% of context can still turn the next request into a large cache write in zeeg's reply.
Kunchenguid put the price claim more sharply: a native full-session compaction can run on cached input, while filtering prior messages before compaction produces a cache miss that he said can cost 10 to 40 times more in kunchenguid's explanation.
Thinking blocks
The selective-rewrite approach now meets a platform constraint as well as a cost tradeoff.
The Anthropic policy shown there says new Fable 5.1 API accounts cannot edit the messages, tools, or system prompt around a thinking block in a multi-turn conversation. Its documented non-strict path drops mismatched thinking blocks from the model's view, rather than preserving them through an edited history.
Theo argued that tool-call pairing no longer gives an external compactor sufficient context for relevance decisions on Anthropic models. Pvncher drew a model-family boundary, saying he would not recommend non-native compaction with GPT models in pvncher's reply.
Safe checkpoints
Compact-adviser moves Jev one layer earlier in the harness. It classifies whether the agent has reached a safe task boundary, then offers a hint or triggers compaction in auto mode rather than pruning tool calls itself.
Its author reported 96 manually labeled checkpoints from 40 real sessions. The displayed threshold starts at 0.90 when context use is at or below 10%, then declines to 0.50 past 90% usage; charted precision falls from 100% to 83% while recall rises from 22% to 77%.
“Safe” meant that the remaining session did not need unpersisted information from the preceding context, as kunchenguid's label description explains.
Disk-backed tool results
Jake Mor described a third contract: preserve tool names and descriptions, retain failures and the latest turns in full, and replace old output with a tool ID plus a note pointing to the response on disk.
That keeps a retrievable record outside the prompt rather than permanently deleting it. A separate Jev memory experiment reported 94% fewer tokens and two to three times faster retrieval, according to moritzkremb's test.