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.
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
| Type | Question | Answers |
|---|---|---|
| Yes / no | Is this read-only tool pair still necessary? | yes · no |
How it works
- Pi supplies older messages at the compaction boundary.
- Code selects eligible read-only tool pairs.
- Jev judges each pair; code removes unnecessary ones.
- 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
Extractive context compaction for Pi that keeps selected original tool records instead of generating a summary.
logicrw/awesome-jev-projects
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.
ProjectbetaJavaScriptAgent plugin that asks Jev whether the session is at a safe boundary to /compact and can trigger it on Pi and Claude Code.
PluginbetaTypeScriptPi extension where Jev judges each completed tool call and result before compaction, keeping key evidence verbatim in the summary.
PluginbetaTypeScriptOh My Pi extension that truncates tool calls and results Jev scores as no longer needed, while keeping all user and assistant text verbatim.
PluginbetaTypeScriptPi extension that prunes stale tool calls with two Jev yes/no questions each, keeping text verbatim and leaving summaries to Pi.
PluginbetaTypeScriptPi port of fast-jev-compaction using Pi's context hook, with a savings gate against low-value pruning and retained status notes.
PluginbetaTypeScript