pi-context-footer

Pi footer with a context bar, drift warning and auto-compact countdown

Packages

Package details

extension

Install pi-context-footer from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:pi-context-footer
Package
pi-context-footer
Version
1.0.1
Published
Oct 22, 2026
Downloads
559/mo · 559/wk
Author
msvart
License
MIT
Types
extension
Size
13.8 KB
Dependencies
0 dependencies · 2 peers
Pi manifest JSON
{
  "extensions": [
    "./extensions/footer.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

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 /compact or 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 off when disabled, and follows /settings changes 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