@fractaal/pi-context-window
Portable per-session and per-model context-window budgets for Pi
Package details
Install @fractaal/pi-context-window from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@fractaal/pi-context-window- Package
@fractaal/pi-context-window- Version
0.1.0- Published
- Aug 25, 2026
- Downloads
- 160/mo · 160/wk
- Author
- fractaal
- License
- MIT
- Types
- extension
- Size
- 59.2 KB
- Dependencies
- 1 dependency · 2 peers
Pi manifest JSON
{
"extensions": [
"extensions/context-window.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@fractaal/pi-context-window
A portable Pi extension that caps the active model's resolved context window. Pi still owns reserve tokens, compaction, overflow recovery, and continuation.
Commands:
/context-windowshows the current model budget./context-window 128ksets the current session override./context-window defaultclears the session override./context-window-default 128ksets the current model's global default./context-window-default defaultclears that global default.
The session override is persisted in the Pi JSONL. Global defaults are stored
in the same profile directory as models.json, using an atomic local JSON file.