Custom Footer
The custom-footer extension replaces pi’s default footer with a rich, color-coded statusline that keeps the most useful session metrics visible at all times. Here it is in action:
$ pi
> colorize the footer example
✓ edited custom-footer.mdx
± turns red and the bar shifts through yellow to red as usage climbs.Layout, left to right:
What it shows
Section titled “What it shows”| Segment | Meaning |
|---|---|
folder |
Current working directory’s folder name |
[± branch] |
Git branch — ● when clean, ± (red) when there are uncommitted changes |
↑ input |
Cumulative input tokens for the session (green arrow) |
↓ output |
Cumulative output tokens for the session (red arrow) |
| Context bar | Progress bar of total tokens vs. the model’s context window |
model |
Active model id |
The context bar is color-coded by usage:
- green
< 70% - yellow
70–90% - red
> 90%
The extension listens to branch-change events and re-renders automatically, so git status stays current as you work.
Installation
Section titled “Installation”The extension is a single TypeScript file. Pi auto-discovers extensions placed in
~/.pi/agent/extensions/, so there is nothing to compile — TypeScript is loaded
via jiti.
Option 1: Copy the file
Section titled “Option 1: Copy the file”mkdir -p ~/.pi/agent/extensionscp custom-footer.ts ~/.pi/agent/extensions/Option 2: Symlink from a checkout (recommended for development)
Section titled “Option 2: Symlink from a checkout (recommended for development)”mkdir -p ~/.pi/agent/extensionsln -sf ~/projects/jreb-pi-extensions/custom-footer.ts ~/.pi/agent/extensions/With a symlink, edits to the source file are picked up on /reload with no
copy step.
Activate it
Section titled “Activate it”/reload # pick up the new extension/footer # toggle the custom footer on (and off again)The extension enables itself automatically on every session_start, and the
/footer command toggles it on or off at any time.
Configuring the context window
Section titled “Configuring the context window”The context bar needs to know the active model’s context window. If your model’s
window isn’t detected (for example a local or custom model), add it to
~/.pi/agent/models.json:
{ "providers": { "your-provider": { "models": [ { "id": "your-model", "contextWindow": 262144 } ] } }}When no context window is known, the footer falls back to a plain
ctx: <tokens> readout instead of the progress bar.