@claaslange/pi-context-budget
Pi extension that warns when conversation context usage crosses configured thresholds.
Package details
Install @claaslange/pi-context-budget from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@claaslange/pi-context-budget- Package
@claaslange/pi-context-budget- Version
0.1.0- Published
- Mar 31, 2026
- Downloads
- 19/mo · 7/wk
- Author
- claas_lange
- License
- unknown
- Types
- extension
- Size
- 6.8 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"extensions": [
"./extensions/context-budget-warning.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
pi-context-budget
A reusable pi package that warns when a session starts getting too close to the model's context limit.
What it does
- warns when the session crosses:
- 100k tokens
- 150k tokens
- 200k tokens
- uses escalating severity:
- 100k: awareness
- 150k: warning
- 200k: error-style warning
- shows a warning widget below the editor only after a threshold is reached
- keeps pi's built-in footer unchanged
- includes the percentage of the active model context window when pi knows it
Install
From npm:
pi install npm:@claaslange/pi-context-budget
From git:
pi install git:github.com/claaslange/pi-context-budget
From a local checkout:
pi install .
Project-local install:
pi install -l npm:@claaslange/pi-context-budget
Development
Run from a local checkout with:
pi -e ./extensions/context-budget-warning.ts
Or install the local package:
pi install .
If pi is already running, reload extensions:
/reload
Package layout
package.json— pi package manifestextensions/context-budget-warning.ts— extension entry point