Developer tools#Coding agent

fast-jev-compaction: a Claude Code diet that deletes instead of summarizing

fast-jev-compaction swaps Claude Code's lossy compaction for Jev decisions: stale tool calls and results are deleted or truncated; your text stays verbatim.

Project facts

GitHub Ecosystem
Repositorygithub.com/tamaratran/fast-jev-compaction
License
MIT
Language
TypeScript
Stars
7,595
Data checked
2026-10-12

Snapshot figures reflect the check date and may change over time.

Anyone who runs long Claude Code sessions has met this: /compact summarizes away the constraint you kept repeating, the exact error text, the command flags you were careful about — and the model starts making the same mistake again. Built-in compaction asks an LLM to summarize old turns, and a lossy summary drops precisely the details that mattered later. fast-jev-compaction, open-sourced on 2026-09-17 as both a Claude Code plugin and an npm library (MIT, TypeScript, 7.6k stars as of 2026-10-12), takes a blunt position: it never rewrites anything, it only deletes.

Core features

  • Delete, never rewrite: only tool calls and results are candidates; user and assistant text stays byte-for-byte and in order. What gets removed is decided by Jev answering two Noul questions — is this call still relevant, is this result worth keeping verbatim — not by a summary.
  • Three tiers with a tunable threshold: answers split into keep, truncate, and remove by keepThreshold (default 0.5); demoted tool inputs step down to 1,000, then 200, then 60 characters, and a dropped result keeps its first 300 characters plus a note.
  • Budgets you can read: state is fitted into maxStateTokens (25k by default) and requests stay under maxRequestTokens (30k by default, under Jev’s 32k request limit); the first message and the newest preserveRecentMessages (default 6) are pinned.
  • The judgment context can be narrowed: goal defaults to the last 3 user prompts as the basis for decisions, and a dropped result keeps its first 300 characters (truncateHeadChars) plus a note, so nothing disappears silently.
  • Usable as a plain library: compactMessages(transcript, { preserveRecentMessages: 4 }) is the whole integration — Message is a subset of Claude Code’s SessionMessage, so a session transcript can be passed in as is; bring your own transport by implementing JevAsker’s ask(state, questions).
  • Fails open to the built-in summary: a Jev failure, malformed answer, missing key, or a history that will not fit the state throws, and the hook falls back to Claude Code’s built-in compaction, with a toast saying so.

Typical use cases

  • Long-session users tired of compaction loss: a project rule like “Never edit src/generated” survives verbatim while stale tool results are dropped.
  • TypeScript engineers building agent frameworks: you want one controllable compression function with explicit 25k/30k budgets and a reductionRatio gate, not a plugin.
  • Anyone A/B-testing compaction: keep the original transcript or switch back to summarizing when reductionRatio(result) < 0.25; result.stats reports message counts before and after, decisions by reason, and which fitting stage was hit.

Quick start

As a plugin (recommended):

claude plugin marketplace add tamaratran/fast-jev-compaction
claude plugin install fast-jev-compaction@fast-jev-compaction

Two prerequisites: set CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 and TYPESAFE_API_KEY in ~/.claude/settings.json, then restart Claude Code or run /reload-plugins. Function hooks are an early-access Claude Code feature (2.1.274+), which is why this is not yet an install-and-forget plugin. Library only: npm install fast-jev-compaction and read the key from the environment.

Summary

fast-jev-compaction fits developers who live in long Claude Code sessions and anyone who wants explicit control over context budgets. The honest caveats: token sizes are character estimates, not a tokenizer; a probability is not proof that a result is safe to delete, in the README’s own words; the full state is resent with every request, so a history near the ceiling costs one request per handful of questions; and never commit the key. Its macOS SwiftUI demo app exists to be screen-recorded and never calls the API. MIT-licensed, written in TypeScript. For another Claude-side local tool, see CCBaga; this plugin carries the “context bill” section of the ten Jev use cases roundup.