Skip to content
HomeNewsDigestsConceptsGuidesToolbox
AboutSubscribeUA
Subscribe

AI Today Brief

The daily AI-engineering brief. Built in public. EN · UA.

XTelegramLinkedInYouTubeRSS

Follow AI Today Brief on LinkedIn for daily AI-engineering updates and the weekly “5 shifts that changed how developers work” PDF.

Explore

NewsDigestsConceptsGuides

Company

SubscribeAdvertiseAbout

Legal

Editorial policyAI disclosurePrivacyTerms

© 2026 AI Today Brief. All rights reserved.

  1. Home/
  2. News/
  3. Token & cost optimization/
  4. Fast Jev Compaction Replaces Lossy Summaries in Claude Code
Token & cost optimization

Fast Jev Compaction Replaces Lossy Summaries in Claude Code

A new Claude Code plugin and npm package uses fast probability scoring to prune stale tool calls and outputs instead of summarizing them. By keeping kept messages verbatim, it prevents lost paths, constraints, and syntax errors.

September 19, 2026· 6 min read
OKCurated by Oleksandr Kuzmenko, AI Product Engineer·Updated September 19, 2026·Sources cited on every story
AI-assisted · editor-reviewed·How we use AI
Fast Jev Compaction Replaces Lossy Summaries in Claude Code

Impact: Medium

Why it matters

You can eliminate the subtle bugs and lost constraints caused by LLM context summaries during long agentic coding sessions.

TL;DR

  • 01Replaces context-destroying summaries by pruning only obsolete tool calls and outputs.
  • 02User prompts, assistant code, and reasoning steps are preserved verbatim.
  • 03Automatically falls back to built-in compaction if size reduction is less than 25%.

Key facts

Default maxStateTokens25,000
Default maxRequestTokens30,000
Default maxStateTokens
25,000
Default maxRequestTokens
30,000
Minimum compaction reduction ratio
0.25 (25%)
Minimum Claude Code version
2.1.274+

Verbatim History Over Lossy Summaries

When long agent sessions trigger context compaction, standard summaries often wipe out essential constraints like "never edit src/generated" or nuanced syntax errors. The fast-jev-compaction utility acts as both a standalone npm package and a Claude Code hook plugin that preserves conversation messages verbatim while selectively pruning obsolete tool calls.

How Jev Scoring Works

1. State Fitting: The session state is fitted into maxStateTokens (default 25,000) using progressive compression: tool inputs drop from 1000 to 200 to 60 characters, and long texts collapse to head/tail slices. 2. Decision Matrix: For each tool call, Jev scores two questions against keepThreshold: should the call stay, and should the result stay verbatim? 3. Pruning Execution: If keepResult meets the threshold, both call and output remain. If only keepCall passes, the result is truncated to truncateHeadChars with a stub notice. If neither passes, the entire call and result pair is removed. 4. Fallback Handling: If the transcript cannot be fitted or the reduction ratio is under 0.25 (25%), Claude Code safely falls back to standard compaction.

Setup via Function Hooks

Function hooks require Claude Code 2.1.274 or newer with the experimental flag enabled in ~/.claude/settings.json:

{
  "env": {
    "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1",
    "TYPESAFE_API_KEY": "<your-key>"
  }
}

Try it in 2 minutes

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

bash

✓ When to use

  • Use in multi-hour autonomous coding loops where tool outputs quickly saturate the context window.
  • Use when standard compaction summaries cause your agent to forget previous architectural constraints.

✕ When NOT to use

  • Do not use if you lack a TypeSafe API key or run completely offline environments.
  • Avoid for tiny sessions where context size never approaches the compaction boundary.

What to do today

  • →Set CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 in your Claude Code environment configuration.
  • →Install the marketplace plugin via claude plugin install fast-jev-compaction@fast-jev-compaction.
  • →Export your TYPESAFE_API_KEY to test verbatim context compaction on heavy coding tasks.
#Claude Code#fast-jev-compaction#TypeSafe Jev

Sources

  • fast-jev-compaction GitHub Repository
ShareShare on XShare on LinkedIn
← Previous storyClaude Code Adds AGENTS.md Support and Free Server-Side Auto ModeNext story →Hardening Agent Sandboxes After Gemini Test Breakout Breaches External Systems

Related stories

  • Token & cost optimizationAnthropic Open-Sources Claude-Generated Custom GPU Kernels for 4x Faster Inference
  • Token & cost optimizationOpenAI Rebuilds Core Storage Service in Rust with Two Engineers and AI
  • Token & cost optimizationDeepSeek Releases V4.1 Flash Slashing Cached Token Costs by 60 Percent
  • Token & cost optimizationPonytail Plugin Cuts AI Coding Agent Output by Half While Preserving Safety

Email digest

Get the morning AI brief

One email a day — the stories that matter for engineers, founders and tech leads. Human-edited, with links to primary sources.

  • ✓120+ sources scanned daily
  • ✓Edited by a human
  • ✓1 email per day
  • ✓EN + UA

By subscribing you agree to the privacy policy.