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. put your TypeSafe API key in ~/.claude/settings.json
# (mods are on by default in Claude Code v2.1.287+ — the early-access flag the README still asks for is ignored, no need to set it):
{ "env": { "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 shipped as on-by-default Claude Mods in Claude Code v2.1.287 (2026-10-01); the README still carries the early-access flag instructions, which the official docs say Claude Code ignores from that version. 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

  • clawd-conduit

    Plugin / Agent

    Wire all 15 Claude Code hook events into the Clawd on Desk desktop pet — and turn permission requests into a blocking desktop card.

    • hooks
    • desktop
    • notifications
    • claude-code
  • 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