pi-context-footer1.0.1
Pi footer with a context bar, drift warning and auto-compact countdown
Untested on omp
This is a pi package. No one has reported whether it works on omp yet. If you try it, add your result below.
Reports 0
No reports yet.
Readme
pi-context-footer
A footer for pi that makes context usage easy to read at a glance.
~/proj main claude-opus-5-5 • high
███┃ ┃ 17.2% 172k/1.0M ▲ over 150k compact in 812k cache: in 122 out 23k hit 98.2%
LSP Inactive
- Context bar – green while below the drift limit, yellow above it, red within 10% of auto-compact.
- Yellow marker – the drift limit (default 150k tokens). Long contexts make models drift and forget; this is the point to consider
/compactor a new session. - Red marker – where auto-compact triggers (context window minus
compaction.reserveTokens, including per-model overrides). - Countdowns – tokens left until the drift limit and until auto-compact. Shows
auto-compact offwhen disabled, and follows/settingschanges live. - Cache – session input/output totals and the latest request's cache hit rate.
- Narrow terminals – stats move to their own line, the bar shrinks, and low-priority parts drop before the percentage and drift warning do.
Extension statuses (ctx.ui.setStatus) are shown on the last line, like the built-in footer.
Install
Requires pi 1.4 or newer.
pi install npm:pi-context-footer
# or from git
pi install git:github.com/msvart/pi-context-footer@v1.0.1
/builtin-footer restores pi's built-in footer for the current session.
Settings
Set the drift limit in ~/.pi/agent/settings.json or a project's .pi/settings.json:
{
"contextFooter": { "warnTokens": 100000 }
}
There is no single right value. The limit is about absolute tokens, not the share of the window: stronger models stay accurate longer, while small or fast models often lose precision earlier. Lower it for models where you notice drift before the marker.
The marker is hidden when the model's context window is not larger than the limit.
License
MIT