alandarev’s pi-context-guard-jev trims old tool output from a coding agent’s working context. Jev selects chunks to retain; the extension copies those lines verbatim and leaves retrieval instructions for omitted material.
Keep selection separate from rewriting
- A coarse question asks whether the whole output remains necessary.
- A Choice question identifies the most important chunk. Separate yes/no questions select additional chunks.
- Pi records append-only context edits, leaving the original session entries available through a
recalltool. - Request failures and timeouts retain the affected segments. Optional checkpoints process older outputs while a long task is still running.
One Choice answer can name only one chunk. The author’s probes show why treating its probability distribution as a multi-selection result loses other relevant files.
Smaller context can cost more immediately
The author reports these single-run comparisons; the live-model results were not independently reproduced:
- A Claude Sonnet 5.5 code-search follow-up carried 15.5k tokens with the guard, versus 28.2k without.
- That follow-up’s main-model cost rose to $0.033 from $0.016, because editing earlier messages forced the prompt cache to be rewritten.
- A GPT-6 Luna file-reading example used 9.2k tokens instead of 35.3k. Its next request also cost more.
- In the author’s longer GPT-6 Luna examples, default checkpoints held peak context to 45.0k tokens, against 68.4k and 87.7k in two unguarded runs.
The runs take different paths, so those figures describe examples rather than a controlled quality benchmark. Cache-aware gates defer some edits until later requests are expected to repay their cost.
Recoverability still depends on the agent
Typed answers make Jev’s selections easy to apply. They do not establish that the retained chunks contain everything a future task needs.
The author’s history probes still discarded relevant lines, even after adding earlier task context. recall preserves a recovery route, but the agent must notice the gap and use it. Old screenshot removal follows an age rule, without a Jev judgment.
Review the outbound data before trying it
The default classifier route sends selected prompts, progress text, earlier-message excerpts and tool-output text through OpenRouter and TypeSafe. Source code and logs can be included. This capture did not enable that route or install the extension into an active agent.
Verification: inspected version 0.3.2, including the classifier call, decision interpretation, context edits and recall implementation. Its TypeScript check and all 207 unit tests passed locally. No live Jev calls, end-to-end model runs or security audit were performed.