0388GitHub
pi-jev-compact
Selective, verbatim context compaction for Pi using Jev model.
ilkerulusoy/pi-jev-compactREADME ↗
# pi-jev-compact Selective, verbatim context compaction for [Pi](https://pi.dev) using TypeSafe's Jev model. Jev scores every tool call and its result; calls that are no longer needed are dropped, the rest stays verbatim. No LLM writes a summary of your conversation. **Status: implemented, 85 tests passing, run against live Jev.** Every test uses a fake Jev or a stubbed transport, so no test observes real model judgment. Live runs have compacted real sessions, but the quality of Jev's keep and drop decisions has not been measured against any reference. Read the section on the context indicator before judging a run by the footer percentage. Independent project. Not affiliated with TypeSafe AI or the Pi authors. ## Why Pi's built-in compaction asks an LLM to summarize old turns. A summary is lossy: an exact error string, a file path, a command, or a constraint can disappear right when it becomes relevant again. Nothing is ever rewritten or paraphrased. Jev is asked, per tool call, whether the call and whether its output still matter, and what it says is no longer needed is deleted. What remains is byte-identical. By default only tool calls and their results are candidates, which is also the limit in both projects this design is taken from. That leaves a ceiling: in a long session the largest part of the context is assistant prose, so removing every tool result may still only reclaim a fraction of it. `/jev-compact text` adds prose to the candidates. Measured on a synthetic 1,860-message window, 15.5% reclaimed became 33.5%. Prose is opt-in and held to a stricter threshold for one reason: a dropped tool result can be recovered by running the tool again, and dropped reasoning cannot be recovered at all. User messages are never candidates in either mode. Prior art t