ClaudeMap

fast-jev-compaction

A Claude Code plugin that replaces the lossy compaction summary with Jev-scored pruning: stale tool calls are dropped, and everything kept stays verbatim.

Plugins & Agentsplugincontext-managementcompactionfunction-hooksjev

Most compaction asks a model to summarize old turns, and a summary can lose a file path, an exact error, or a constraint that matters later. fast-jev-compaction never rewrites anything: every tool_use/tool_result pair is scored by Jev (TypeSafe) against the whole conversation, stale ones are dropped or truncated, and user and assistant text stays verbatim and in order. It ships as an npm library (compactMessages with typed decisions and stats) and as a Claude Code function-hook plugin that takes over /compact and auto-compaction, falling back to the built-in summary when Jev fails or cannot remove enough. Recent messages and first-message calls are pinned; token fitting, batching, and the keep/truncate/drop thresholds are all configurable.

What it does

  • Never summarizes: only deletes or truncates tool calls and results Jev scores as no longer needed — everything kept stays verbatim
  • Three-way decision per call: keep the result, keep the call with a truncated result, or drop both; recent messages are pinned and never touched
  • Dual form: an npm library (compactMessages, reductionRatio, injectable JevAsker) and a function-hook plugin replacing /compact and auto-compaction
  • Fail-open by design: Jev errors, malformed answers, or insufficient reduction fall back to Claude Code's built-in summary

When to use it

Long sessions where exact file paths, error text, or constraints from earlier turns must survive compaction — and anyone building programmatic transcript pruning who wants deletion decisions with probabilities instead of a lossy rewrite.

Getting started

# 1. function hooks are early access (Claude Code 2.1.274+) — in ~/.claude/settings.json:
{ "env": { "CLAUDE_CODE_ENABLE_FUNCTION_HOOKS": "1", "TYPESAFE_API_KEY": "<your key>" } }

# 2. install the plugin:
claude plugin marketplace add tamaratran/fast-jev-compaction
claude plugin install fast-jev-compaction@fast-jev-compaction

# 3. restart Claude Code or run /reload-plugins
# /compact now prunes verbatim; the toast reports kept N/M or fallback

Things to know

Requires a TypeSafe API key and sends conversation state to TypeSafe's Jev for scoring. Function hooks are an early-access Claude Code feature (2.1.274+). The npm package named in the README was not yet published on the public registry when reviewed (2026-09-19), so the plugin path is the installable one. A keep probability is not proof a result is safe to delete — the assistant may have to re-run a dropped tool. MIT.

Repository

tamaratran/fast-jev-compaction

Charted

Related on the map

  • CometixCode

    Plugin / Agent

    An unofficial Rust 1:1 reimplementation of the Claude Code terminal UI, ported file-for-file onto an iocraft TUI framework.

    • terminal-ui
    • rust
    • reimplementation
    • unofficial
  • Abide

    Plugin / Agent

    Hook-level enforcement for the natural-language rules in AGENTS.md and CLAUDE.md — every edit is judged and violations are repaired in the same turn.

    • hooks
    • code-review
    • rules
    • agents-md
  • Anthropic's official Claude Cowork plugin for financial advisors — eight ready-to-run compliance-aware workflows over the firm's own connectors.

    • official
    • plugin
    • finance
    • cowork