fast-jev-compaction prunes Claude Code history without paraphrasing it

Claude Code compacts a long transcript when it approaches the context limit, replacing earlier turns with a generated summary. That summary can omit an error string, file path, shell command, or constraint needed later. Developer Tamara Tran has published fast-jev-compaction, an MIT-licensed plugin that uses TypeSafe’s Jev model to score historical tool calls for retention. User and assistant messages remain verbatim, while tool calls and results can be kept, truncated, or removed.

Tran distributes the project as both an npm package and a Claude Code function hook. When /compact or auto-compaction runs, the hook asks Jev which tool interactions still matter, applies those decisions in code, and invokes Claude Code’s built-in summarizer if Jev fails or removes too little.

Why classification fits compaction

TypeSafe describes Jev as a model for software-directed decisions. It returns typed choices, scores, and probability distributions that programs can consume directly. The company calls it a System One model trained with Reinforcement Learning for Calibrated Decisions, or RLCD. A request supplies shared state alongside several structured questions.

fast-jev-compaction maps that interface onto context management. Jev answers narrow retention questions for each eligible tool interaction, and deterministic TypeScript applies the results. Retained text stays exact because the model never generates replacement prose.

A pruning pipeline with guardrails

The library preserves all user and assistant text in its original order. Its pruning scope covers paired