← Catalog

@giladbarnea/pi-custom-footer

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

Package

Install

Install with PiG

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

Install with Pi

pi install npm:@giladbarnea/pi-custom-footer
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.1.20 (README.md). PiG does not review it.


last_updated: 2026-11-15T13-19

Know how much context remains. See what each turn costs.

pi extension npm license

A Pi footer that puts your session’s context, cache usage, cost, and loaded skills around the editor.

Mobile-friendly and optimized for multiplexers. It works on a phone with the keyboard up, in a narrow tmux pane, and on a wide desktop. Every line drops its least important detail first, so you keep the facts that matter at any size.

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

Supports Pi 1.5.x and 1.6.x, the latest stable minor and its predecessor.

Above the editor, see your model, thinking level, session name and ID. Loaded skills get their own row, with token ages. Compaction and context edits remove skills whose loaded text is no longer present verbatim. Restoring that text restores the skill. A skill read inside a codemode script counts when the script output carries that read verbatim. Pi does not keep nested read results, so the footer records the read text in a custom session entry that is never sent to the model.

Below the editor, see:

  • Context remaining at a glance: a color-graded gauge and used/window tokens.
  • Cost across the conversation: cumulative cost and average cost per assistant turn.
  • Cache behavior: session hit rate, with reused tokens when there is room (97.6% session (38M reused)), and the last message as hit 100% or miss 45%. A hit means more than 90% of the prompt was read from the cache. Like Pi’s own notice, a miss that re-billed cached tokens shows what it cost and why it happened: an idle gap or a model switch.
  • How long the cache stays warm: warm for 26m, live: the footer redraws once a minute. It counts down to the latest of three times: the last request or cache warm plus the model’s cache lifetime; the end of Pi’s own idle warming, when Pi will refresh this context; and a deadline set with pi-keep-cache-warm in this Pi session. Once that time has passed, the fact hides. Pi’s idle warming counts on Pi 1.5.1 and later; earlier versions show last touch plus lifetime. Models without a declared cache lifetime, such as OpenAI and Codex, show nothing.
  • Where you are: Git branch, dirty marker, directory, and other extensions’ status messages.
  • Subscription pace: this week’s pace against the target rate, as pace ━━━━●┊─── 1.07× ≤ target 1.18× · resets in 12h. With less room, it reads pace ≤ target (1.18×), then pace ≤ 1.18×. The sign turns to > when you are over budget, and the dot passes the time marker. A reading more than 30 minutes old adds its age, such as · 2h old. The age outlasts the pace bar and goes before the rest of the pace. Optional: shown only when a quota cache file exists.

The layout follows your Pi theme. The header and the footer each take the fewest lines they can. To fit, the footer first drops the optional reused-token suffix, before any other detail or fact. It then drops the pace bar and labels, round readings, remove whitespace, and drop the branch icon. The cache time drops its label (26m). A hit or miss drops its percentage. Only then does the footer hide facts: the sub mark of a subscription, a stale reading's age, the pace reading with its reset time, the last message's plain hit or miss, the token counts, the session hit rate, the word target, the cache time, and last the cost per turn. The target rate stays down to pace ≤ 1.18×. A cache miss drops its re-billed tokens early. It keeps its cause until every one of those facts has hidden, and keeps its cost to the end. Last, the target rate hides only where it alone would add a line.

Skills get one row for every eight terminal rows past the first six, with a minimum of one. A 21-row phone screen gets one row, a 27-row screen two, and a 34-row screen three. To fit, the row first drops token ages, then separators, then shortens long names in the middle (caut…ctor). Only then does it hide skills from the end, behind a +N count at the end of the last row.

Resize without rescanning the conversation. The header and footer share cached values. Session changes refresh them, including forks and compaction.

Skill age measures context-token growth since the first response after a skill load. Cache misses mirror Pi’s own miss accounting: the tokens re-billed since the last request or cache warm, their extra cost over cache reads, and the idle time. Costs use the model’s reported pricing, including when you use a subscription. Numbers show two decimal places below 10, one from 10, and none from 100.

The pace comes from ~/.cache/quota/provider-usage.json (or under XDG_CACHE_HOME), which the author’s quota tool writes. That tool is not public yet, and without the file the footer shows no pace. The reading is for the pool of the session’s model: Claude, Fable or Codex. The footer only reads that file. It never runs quota and never fetches. Pace, sign and target share one color from quota’s heat map, read as pace over target: green within 5% of the target, bluer the slower you burn, redder the faster. A Fable session shows Fable’s target capped by the room left in the shared Claude week.

Development

npm ci
npm test
npm run check

Tests cover rendered values, skill tracking, cache reuse, session changes, forks, compaction, and native context edits. SDK tests use a local scripted provider, with no external model calls.