@giladbarnea/pi-custom-footer

Context, cache, cost, and loaded skills at a glance in Pi.

Packages

Package details

extension

Install @giladbarnea/pi-custom-footer from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@giladbarnea/pi-custom-footer
Package
@giladbarnea/pi-custom-footer
Version
0.1.21
Published
Nov 30, 2026
Downloads
2,919/mo · 489/wk
Author
giladbarnea
License
MIT
Types
extension
Size
673.8 KB
Dependencies
0 dependencies · 3 peers
Pi manifest JSON
{
  "image": "https://raw.githubusercontent.com/giladbarnea/custom-footer/main/assets/hero-editor.png",
  "extensions": [
    "./index.ts"
  ]
}

Security note

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

README

Muted slate-blue, sage, and ochre light diffused across a dark horizon slit

Custom Footer

Context, prompt cache, cost, and loaded skills — ranked to fit any screen.

Pi extension npm version npm downloads CI tests Pi 1.5 and 1.6 zero dependencies TypeScript MIT license

A live, theme-native cockpit around Pi’s editor — built from a 40-column phone up to a wide desktop.

Custom Footer wrapping the Pi editor: model, thinking level, session name and ID, and loaded skills with token ages above; git branch, cwd pill, context gauge, cost, prompt cache hit rate, and live warm countdown below

Model, thinking, session ID, and loaded skills above the editor; place, context, spend, cache health, and warmth below.


Install

pi install npm:@giladbarnea/pi-custom-footer

Pi 1.5.x & 1.6.x · Node >= 22.19 · zero runtime dependencies · zero config.


Mobile friendly

Most status bars clip or explode into five lines the moment you open a tmux split, switch to an iPad, or SSH in from a phone.

Custom Footer ranks every detail and sheds what matters least first — down to a 40×21 phone screen with the keyboard up.

The same live Pi session rendered at four terminal sizes: 146x40 desktop, 98x30 tmux split, 56x24 narrow pane, and 44x21 phone over SSH

The same live session from desktop to phone over SSH. Skill rows scale with terminal height.

  • Width-ranked: drops suffixes, labels, rounding, and icons before hiding any fact.
  • Zero-cost resize: header and footer share one cached snapshot and never rescan history on resize.

Prompt cache that explains itself

See cache health while you can still act on it.

  • Session reuse & last turn: 98.8% session (2.0M reused) plus hit 99% / miss 45% (> 90% cached = hit).
  • Miss alerts that stick: flags idle gaps or model switches with extra cost (miss after 6m idle: 199k re-billed $0.38) — outranking routine stats on narrow screens.
  • Live warm countdown: warm for 26m, ticking every minute across cache TTL, Pi 1.5.1+ idle warming, and pi-keep-cache-warm.

Three rendered footer states: healthy and warm with quiet green ramps; a 6-minute idle cache miss at full width, 44 columns, and 34 columns; and high context pressure with an over-budget weekly quota pace bar

Quiet when healthy. Loud only when something needs action.


Loaded skills, with context depth

A row above the editor lists every skill still in context alongside its token age (tdd -18k) — how far context has grown since it loaded.

  • Every load path: tracks /skill, direct read, and nested read inside codemode scripts.
  • Truthful across edits: compaction, forks, and native context edits drop skills removed verbatim and restore them if brought back.
  • Height-aware: 1 row at 21 terminal rows, 2 at 22–29, 3 at 30–37; sheds ages → separators → middle-truncation (caut…ctor) → +N.

Theme-native color grammar

Zero hardcoded colors. Truecolor RGB blending from your active Pi theme, with clean 256-color fallback.

  • Ramps for measurements: context, cache, and pace stay muted when healthy and heat up only when actionable.
  • Families for categories: place (branch + cwd/ pill), spend ($1.69 sub), machine (model/thinking), and skills each hold one steady hue.
  • Zero clutter: strips redundant cwd prefixes from session names, scales decimals by magnitude ($1.69, $12.3, $123), and renders other extensions’ statuses below.

Under the hood

Shrink order

Each region picks the fullest state that achieves the fewest lines:

  • Footer formatting: (reused) suffix → pace bar & resets in → labels → cache share & rounded cost → padding & separators → branch icon.
  • Footer facts: sub → stale pace age → pace & reset time → plain hit/miss → token counts → session hit rate → target → warm time → cost/turn → miss cause (keeps cost) → target rate (only if it alone adds a line).
  • Header: separators → thinking (high → h) → session ID (first two segments).
  • Skills: token ages → separators → middle-truncate (caut…ctor, 4 chars/side) → +N.

Optional weekly quota pace

pace ━━━━●┊─── 1.07× ≤ target 1.18× · resets in 12h

  • Passive & offline: reads ~/.cache/quota/provider-usage.json (Claude, Fable, or Codex) — never runs commands or fetches; hidden if absent.
  • Heat-mapped: dot passes ┊ and ≤ flips to > when over budget; readings past 30m show their age (· 2h old).

Works well with


Development

npm ci
npm test
npm run check

Offline tests cover 30–240 column layouts, height-scaled skills, Pi cache-miss parity, expiry timing, forks, compaction, and context edits.