npm package discovery and stats viewer.

Discover Tips

  • General search

    [free text search, go nuts!]

  • Package details

    pkg:[package-name]

  • User packages

    @[username]

Sponsor

Optimize Toolset

I’ve always been into building performant and accessible sites, but lately I’ve been taking it extremely seriously. So much so that I’ve been building a tool to help me optimize and monitor the sites that I build to make sure that I’m making an attempt to offer the best experience to those who visit them. If you’re into performant, accessible and SEO friendly sites, you might like it too! You can check it out at Optimize Toolset.

About

Hi, 👋, I’m Ryan Hefner  and I built this site for me, and you! The goal of this site was to provide an easy way for me to check the stats on my npm packages, both for prioritizing issues and updates, and to give me a little kick in the pants to keep up on stuff.

As I was building it, I realized that I was actually using the tool to build the tool, and figured I might as well put this out there and hopefully others will find it to be a fast and useful way to search and browse npm packages as I have.

If you’re interested in other things I’m working on, follow me on Twitter or check out the open source projects I’ve been publishing on GitHub.

I am also working on a Twitter bot for this site to tweet the most popular, newest, random packages from npm. Please follow that account now and it will start sending out packages soon–ish.

Open Software & Tools

This site wouldn’t be possible without the immense generosity and tireless efforts from the people who make contributions to the world and share their work via open source initiatives. Thank you 🙏

© 2026 – Pkg Stats / Ryan Hefner

pi-stats-footer

v0.4.0

Published

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

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:[email protected]   # 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