pi-context-steward 1.0.0 → 1.0.1
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +4 -0
- package/README.md +22 -0
- package/package.json +1 -1
package/CHANGELOG.md
CHANGED
package/README.md
CHANGED
|
@@ -22,6 +22,28 @@ In 11 runs of the same task with Claude Opus 5.5 at a 128k budget, the recommend
|
|
|
22
22
|
|
|
23
23
|
Compared with plain Pi, the default setting cost **38% less**, finished **35% faster** and read **half as many files**. Every run reached the task goal. Run counts are small. The full study, including what it does *not* show, is in [docs/RESULTS.md](https://github.com/deemkeen/pi-context-steward/blob/main/docs/RESULTS.md).
|
|
24
24
|
|
|
25
|
+
## How it compares
|
|
26
|
+
|
|
27
|
+
Several Pi packages manage context. What sets this one apart:
|
|
28
|
+
|
|
29
|
+
- **The model sees the meter, not just you.** Display packages show *you* how full the context is. This extension shows the *model*, in every tool result. With Opus 5.5 that alone changed behavior: it started writing findings to disk before a compaction could lose them. None of the packages below gives the model this signal.
|
|
30
|
+
- **Consolidation without a model call.** Summarizing pruners send finished tool batches to a summarizer model, which costs extra requests and latency. Here, rule-based stubs replace stale and bulky results, and the originals go to disk. A consolidation took 0.02–0.4 s in the measured runs.
|
|
31
|
+
- **Priced against the prompt cache.** Anthropic looks for cached prefixes only about 20 content blocks back, so any edit to older history makes the next request re-write the whole conversation. The planner estimates that cost, consolidates late and deep (85% → 35% of the budget, thresholds taken from measured runs) and skips a consolidation that would free too little to pay for it.
|
|
32
|
+
- **More than tool output.** It also shortens large inputs of finished tool calls (file contents passed to `write`/`edit`, long scripts), keeps pinned facts verbatim through compaction, picks its mode per model, and handles model switches.
|
|
33
|
+
|
|
34
|
+
| Package | Approach | Model call to prune | When history is rewritten | Model sees context vs. budget |
|
|
35
|
+
|---|---|---|---|---|
|
|
36
|
+
| **pi-context-steward** | Rule-based stubs and input shortening; originals on disk | **No** | **Rarely:** near the budget, only when it pays off | **Yes** |
|
|
37
|
+
| [pi-context-prune](https://pi.dev/packages/pi-context-prune) | LLM summaries of finished tool batches; `context_tree_query` recovers originals | Yes (configurable summarizer) | Per batch; by default the model decides when | No |
|
|
38
|
+
| [pi-condense](https://pi.dev/packages/pi-condense) | Builds on pi-context-prune; adds zero-LLM shortcuts (dedup, spill to file, chain compression) | Mostly | Once per finished unit of work | No |
|
|
39
|
+
| [pi-context-pruning](https://pi.dev/packages/pi-context-pruning) | OpenCode-style: old tool outputs become markers | No | After every turn | No |
|
|
40
|
+
| [pi-context-usage](https://pi.dev/packages/pi-context-usage), [pi-context-view](https://pi.dev/packages/pi-context-view) | Visualize context usage for you | – | Never | No |
|
|
41
|
+
| [pi-cache-optimizer](https://pi.dev/packages/pi-cache-optimizer) | Raises the cache hit rate (stable prompt, cache keys) | – | Never | No |
|
|
42
|
+
|
|
43
|
+
Packages that change compaction itself solve a different problem: they make compaction better or cheaper, while this extension aims to make it rare. Examples are [pi-vcc](https://pi.dev/packages/pi-vcc) (algorithmic, no LLM call), [pi-jev-compaction](https://pi.dev/packages/pi-jev-compaction) (keep/drop/truncate decisions), [pi-observational-memory](https://pi.dev/packages/pi-observational-memory) (memory prepared in the background) and [pi-early-compact](https://pi.dev/packages/pi-early-compact) (compacts early on 1M-window models).
|
|
44
|
+
|
|
45
|
+
**When another package may suit you better:** pi-context-prune is more mature and widely used, and its LLM summaries usually keep more of a result than a rule-based stub. It also has a dedicated recovery tool; here the stub names a file that the model reads back with `read`.
|
|
46
|
+
|
|
25
47
|
---
|
|
26
48
|
|
|
27
49
|
## Contents
|
package/package.json
CHANGED
|
@@ -1,6 +1,6 @@
|
|
|
1
1
|
{
|
|
2
2
|
"name": "pi-context-steward",
|
|
3
|
-
"version": "1.0.
|
|
3
|
+
"version": "1.0.1",
|
|
4
4
|
"description": "Context awareness and cache-aware context management for the Pi coding agent: a persistent context meter, batched consolidation instead of most compactions, and pin-preserving summaries.",
|
|
5
5
|
"keywords": [
|
|
6
6
|
"pi-package",
|