# context-sizeContext-window usage telemetry for Pi.
## Install / loadLoaded through the root `pi-ext` package.
See [root README](../../README.md).
## Commands / tools / settingsCommands:
none.
Tools:
none.
Settings:
none.
Hooks/events:
- `session_start`
- `agent_start`
- `turn_end`
- `agent_end`
- `model_select`
- `session_compact`
- `session_shutdown`
Emits:
- `footer:segment` to publish/clear `context-size` footer segment.
## BehaviorShows current context-window usage as a token ratio plus a 10-cell bar.
If `@bugabinga/pi-ext-footer` is loaded, publishes a `context-size` footer
segment in the `llm` zone.
Otherwise uses Pi status text with id `context-size`.
Token counts are displayed in thousands, rounded.
Usage color:
- `< 70%`:
muted
- `≥ 70%`:
warning
- `≥ 85%`:
error
- unknown percent:
muted
No UI update runs when UI is unavailable.
Clears footer/status when context usage is unavailable.
Clears status on session shutdown.