pi-stats-footer

Compact two-line status footer for pi: model, tokens, cache hit rate, context usage, cost, run timer, agent loop count and current task.

Packages

Package details

extension

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

$ pi install npm:pi-stats-footer
Package
pi-stats-footer
Version
0.4.0
Published
Aug 21, 2026
Downloads
1,232/mo · 13/wk
Author
_wsure_
License
MIT
Types
extension
Size
18.7 KB
Dependencies
0 dependencies · 3 peers
Pi manifest JSON
{
  "extensions": [
    "extensions"
  ]
}

Security note

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

README

pi-stats-footer

A compact, responsive two-line status footer for pi. It shows model, tokens, cache hit rate, context usage, cost, run timer, agent loop count and the current task — all at a glance while pi works.

Claude Sonnet · high │ ↑20.4k ↓1.5k │ cache 90% │ ctx 16%/1M │ $0.13 │ working 0:05
-> loop 3 │ Refactor the payment module to use the new billing API…

Features

Line 1 — session stats

Segment Example Description
Model + thinking level Claude Sonnet · high Current model name (accent color) plus the thinking level, colored per level via theme colors (thinkingOffthinkingMax).
Session tokens ↑20.4k ↓1.5k Total input () and output () tokens for the whole session, summed from assistant messages, tool results, branch summaries and compactions.
Cache hit rate cache 90% Prompt-cache hit rate = cacheRead / (input + cacheRead + cacheWrite). Shows - when there is no prompt traffic yet.
Context usage ctx 16%/1M Current context window usage as percent / window size, color-coded: green < 60%, yellow ≥ 60%, red ≥ 80%. Shows ctx ?/… when unknown.
Session cost $0.13 Accumulated cost of the session ($0.003 precision below $1).
Working timer working 0:05 Live elapsed time of the current agent run (ticks every second); freezes at the final duration once the agent settles (1:02:03 style once over an hour).

Line 2 — current progress

Segment Example Description
Loop count -> loop 3 Agent turns taken so far on the current branch — one per assistant message, i.e. one LLM response plus its tool calls. Updates live while the agent works.
Current task Refactor the payment… Your last user message, sanitized to a single line and truncated with to fit the terminal width.

Behavior

  • Width-aware rendering — segments are fitted to the terminal width in priority order (model first); lower-priority segments drop out gracefully on narrow terminals instead of wrapping. The model segment is hard-truncated with only if it alone is wider than the terminal.
  • Ambiguous-width safe — East Asian Ambiguous characters (, , , ·, , , “ ” …) are measured as 2 columns and one extra column of margin is reserved. CJK terminals/fonts often render these double-width even though wcwidth counts them as 1; measuring them narrowly made fitted lines wrap onto a third row and clobber the tmux status bar. The conservative sizing only ever leaves a little unused space at the right edge.
  • Live updates — re-renders on branch changes, messages, model/thinking level switches and session info changes, plus a 1s ticker while the agent runs.
  • Never crashes the TUI — rendering is fully defensive; on any unexpected state the footer simply returns nothing.
  • Token counts are formatted compactly: 999, 9.9k, 20k, 1.5M.

Styling

The footer uses your pi theme; no hard-coded colors:

  • Model name, ->, loop N, working timeraccent
  • Tokens, cache rate, cost, task textdim
  • Separators ()borderMuted
  • Thinking levelthinkingOff / thinkingMinimal / thinkingLow / thinkingMedium / thinkingHigh / thinkingXhigh / thinkingMax (falls back to thinkingHigh if a theme omits thinkingMax)
  • Context usagesuccess (< 60%), warning (≥ 60%), error (≥ 80%), dim when unknown

Install

From npm (recommended):

pi install npm:pi-stats-footer
pi install npm:pi-stats-footer@0.3.1   # pinned version

From git:

pi install git:github.com/WSure00/pi-stats-footer

From a local clone:

pi install /path/to/pi-stats-footer

Try without installing:

pi -e /path/to/pi-stats-footer

Manage

pi config                       # enable/disable the extension
pi update npm:pi-stats-footer   # update
pi remove npm:pi-stats-footer   # uninstall

npm

https://www.npmjs.com/package/pi-stats-footer

npm view pi-stats-footer

License

MIT