@fractaal/pi-context-window

Portable per-session and per-model context-window budgets for Pi

Packages

Package details

extension

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-window shows the current model budget.
  • /context-window 128k sets the current session override.
  • /context-window default clears the session override.
  • /context-window-default 128k sets the current model's global default.
  • /context-window-default default clears 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.