Skip to content

pi-jev-compaction

Extractive compaction for Pi: Jev judges complete read-only tool pairs, code removes stale ones and keeps the rest as an extractive packet.

ProjectbetaMIT

Overview

Pi Jev Compaction (Wang-auspicious) performs decision-driven, extractive context compaction for Pi. Long coding sessions accumulate old file reads, searches and directory listings; this extension asks Jev to judge complete read-only tool pairs and then uses ordinary code to remove pairs it rates as unnecessary. Everything retained is copied verbatim into an extractive transcript packet; Jev never writes a summary.

Because Pi's supported compaction API accepts a summary string, the packet goes in that field and Pi's native recent-message boundary is preserved; it does not patch Pi, rewrite the session file, or pretend to replace arbitrary history. Pi chooses the compaction boundary via session_before_compact, and code decides eligibility (only uniquely paired, successful read-only pairs) under a conservative selection policy. It was validated on Pi 0.84.2 with Node 22.19+, has CI and a verification document, a Chinese README, and is MIT licensed. It is inspired by fast-jev-compaction.

What the decision model decides

TypeQuestionAnswers
Yes / noIs this read-only tool pair still necessary?yes · no

How it works

  1. Pi supplies older messages at the compaction boundary.
  2. Code selects eligible read-only tool pairs.
  3. Jev judges each pair; code removes unnecessary ones.
  4. Retained items form an extractive packet in Pi's summary field.

Strengths

  • No generated summary; retained content is verbatim.
  • Uses Pi's supported API without patching.
  • Conservative eligibility rules.

Caveats

  • Only validated on Pi 0.84.2.
  • Requires a TypeSafe key and a configured Pi model.

Getting started

pi install git:github.com/Wang-auspicious/pi-jev-compaction@v0.1.0, export TYPESAFE_API_KEY, then /compact in Pi.

At a glance

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

Use cases and integrations

How curated lists describe it

Frequently asked questions

Does Jev write a summary?

No, retained content is copied verbatim into an extractive packet.

Which tool pairs are eligible?

Only uniquely paired, successful read-only tool pairs.

Which Pi version is supported?

Pi 0.84.2 is the validated version.

Related projects

  • Codex plugin that builds handoff packets by asking Jev whether each old read-only tool record should stay, keeping retained text verbatim.

    ProjectbetaJavaScript
  • Agent plugin that asks Jev whether the session is at a safe boundary to /compact and can trigger it on Pi and Claude Code.

    PluginbetaTypeScript
  • Pi extension where Jev judges each completed tool call and result before compaction, keeping key evidence verbatim in the summary.

    PluginbetaTypeScript
  • 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
  • Pi extension that prunes stale tool calls with two Jev yes/no questions each, keeping text verbatim and leaving summaries to Pi.

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

    PluginbetaTypeScript