pi-context-view
Pi extension to visualize context usage and inspect the hidden parts: base prompt, tools defs, and extension injections
Package details
Install pi-context-view from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:pi-context-view- Package
pi-context-view- Version
0.5.0- Published
- Aug 30, 2026
- Downloads
- 4,523/mo · 945/wk
- Author
- dimk90
- License
- MIT
- Types
- extension
- Size
- 200.7 KB
- Dependencies
- 0 dependencies · 2 peers
Pi manifest JSON
{
"extensions": [
"./src/index.ts"
],
"image": "https://media.githubusercontent.com/media/dimk90/pi-context-view/1485fe4da1ddefc832230b14bcc949f2a53d87a2/doc/images/pi-context-view.png"
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-context-view
Pi extension that visualizes context usage and lets you inspect the parts you normally can't see: the system prompt, tool definitions, and instructions injected by other extensions.
Features
Context usage map - visualize used and free context space, grouped by category (tools, skills, messages, and more).
Context injections - explore the hidden parts of the context: the system prompt, tool definitions, and extension injections.
Commands
/context- shorthand for/context usage./context usage- open the context usage visualization./context injections- show the hidden parts of the context captured at session start or resume./context config- create the global configuration file populated with defaults, useful for customization.
Demo
/context
See what fills your context, for example, what survives compaction:

/context injections
Inspect hidden parts of the context, such as tool definitions:

Zoom
Zoom in for a more detailed breakdown of large context windows, such as 1M-token windows:

Install
pi install npm:pi-context-view
Customization
At the moment, only the Context Usage map colors are customizable.
A config populated with the current defaults is a good starting point for customization. Create it with:
/context config
This creates
~/.pi/agent/extensions/pi-context-view.json.
See doc/CONFIG for each parameter's meaning and default value.
Category Colors
You can configure the Context Usage map colors to better match your theme, or set
them to theme-independent hex values. Here are examples of custom
terrain and
rainbow palettes:

See PI-THEME-COLORS for color names that follow the current theme.
Context Footprint
pi-context-view does not add any instructions or messages to the model context.
My Other Stuff
📌 S-VHS - terminal recorder used to create the demo GIFs.
