Skip to content

pi-fast-jev-compaction (KamilPostrozny)

Pi port of fast-jev-compaction using Pi's context hook, with a savings gate against low-value pruning and retained status notes.

PluginbetaMIT

Overview

This pi-fast-jev-compaction is a Pi package port of tamaratran/fast-jev-compaction adapted to Pi's non-destructive context hook. Jev decides, call by call, which old tool calls and results must stay in model context; user and assistant prose is never summarised or rewritten, and Pi's persisted transcript stays intact.

Version 0.7.4 adds a pruning cost gate: an automatic proposal must change actual results and save at least the resolved hysteresis gap in estimated net tool-result tokens (for example 5,632 tokens at a 112,640-token window with 16,384 reserve), otherwise it commits nothing and native compaction proceeds; /jev-refresh overrides. When pruning a read of a Markdown status, handoff or progress file, it keeps deterministic excerpts of constraints, blockers, next steps and validation state rather than an LLM summary. Pressure, cancellation and validation remain driven by Pi's usage numbers.

What the decision model decides

TypeQuestionAnswers
Yes / noDoes this old tool call or result still need to remain in context?yes · no

How it works

  1. Trigger once above the context pressure ceiling.
  2. Ask Jev per tool call and result.
  3. Accept the proposal only if estimated savings exceed the hysteresis gap.
  4. Retain focused status-document excerpts; otherwise defer to native compaction.

Strengths

  • Avoids expensive marginal pruning.
  • Keeps key task facts from status docs.
  • Transcript never modified.

Caveats

  • Savings estimates are heuristic.
  • Requires a TypeSafe key.

Getting started

Install the package into Pi and set TYPESAFE_API_KEY.

At a glance

Type
Plugin
Status
beta
Language
TypeScript
Runtime
Pi extension
Has code
yes
License
MIT

Use cases and integrations

How curated lists describe it

Frequently asked questions

How is this different from other Pi ports?

It adds a savings gate against low-value pruning and keeps excerpts from status documents.

Can I force pruning?

Yes, /jev-refresh accepts any actual pruning.

Is the transcript changed?

No, it uses Pi's non-destructive context hook.

Related projects

  • Oh My Pi extension that truncates tool calls and results Jev scores as no longer needed, while keeping all user and assistant text verbatim.

    PluginbetaTypeScript
  • Automatic Pi context clearing: drops superseded tool outputs for free and asks Jev about large older ones, with originals retrievable.

    ProjectbetaTypeScript
  • winnow★ 110

    Calibrated context sieve for Claude Code: Jev judges each block of large tool output and hides confident-no blocks behind recallable stubs.

    Projectbeta
  • Codex hook that compacts large command and tool outputs, using Jev to rank which chunks matter and keeping the full output retrievable.

    ServicebetaPython
  • Local proxy for Claude Code that uses Jev to remove stale tool results from the context once it reaches about 120K tokens, failing open.

    ProjectbetaJavaScript
  • Claude Code /fc command where Jev picks which old tool outputs to keep whole; the rest are trimmed and saved to files.

    ProjectbetaTypeScript