@vanillagreen/pi-output-policy
Large-output policy for Pi: runaway model-output guards plus tool-result minimization, truncation, and spill preservation.
Package details
Install @vanillagreen/pi-output-policy from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@vanillagreen/pi-output-policy- Package
@vanillagreen/pi-output-policy- Version
2.1.4- Published
- Oct 23, 2026
- Downloads
- 933/mo · 328/wk
- Author
- vanillagreencom
- License
- MIT
- Types
- extension
- Size
- 301.7 KB
- Dependencies
- 0 dependencies · 1 peer
Pi manifest JSON
{
"image": "https://raw.githubusercontent.com/vanillagreencom/kendex/main/pi-extensions/pi-output-policy/assets/settings-panel.png",
"extensions": [
"./extensions/output-policy.ts"
]
}Security note
Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.
README
@vanillagreen/pi-output-policy
A Pi extension that limits large tool results and repeated model output. It saves full tool output to files so the agent can read it when needed.

Features
- Stop model responses that exceed configured size or repetition limits.
- Show a preview of large tool results and save the full output.
- Reduce common shell output while retaining errors and summaries.
- Report saved output paths and the amount removed from the preview.
Install
- npm:
pi install npm:@vanillagreen/pi-output-policy. - kendex: add the declaration below to the project's
kendex.toml, or to~/.config/kendex/kendex.tomlfor user scope. Runkendex update-pi.
[pi-extensions."@vanillagreen/pi-output-policy"]
source = "kendex"
Restart Pi after installation. Use kendex update-pi --check to preview the installation.
How it works
The extension watches model output and completed tool results. It checks them against the selected policy and your overrides. Large tool results become previews with a link to the full saved text. A model response that crosses a configured limit stops with a warning.
Saved files
At session start, the extension deletes saved full outputs whose recorded working directory no longer exists. It also deletes files older than 5 days. This applies to the per-session artifact directory and the temporary-directory fallback.
Setup
The settings editor writes project values to .pi/settings.json. The default user file is ~/.pi/agent/settings.json. PI_CODING_AGENT_DIR changes the user directory. Package values are stored under kendex.extensionManager.config["@vanillagreen/pi-output-policy"].
Open /extensions:settings; settings appear under the Output Policy tab. Project settings in .pi/settings.json apply only after Pi marks the workspace trusted.
enabled: package toggle; disabling it is the only way to get verbatim inline output, sincecompatstill spills above its caps.policyMode:balanced,compactorcompat.- Model output guard:
modelOutputGuard.enabled,modelOutputGuard.maxChars,modelOutputGuard.repetition.enabled,modelOutputGuard.maxConsecutiveRepeats,modelOutputGuard.minRepeatBlockChars,modelOutputGuard.minRepeatedChars; changes apply to the next assistant message. - Truncation:
truncateReadOutputs,truncateMutationOutputs,spillThresholdKb,inlineTailKb,inlineTailLines,preserveFullOutput. - Display limits:
maxTextBlockKb,maxLineCount,maxLineWidth,sanitizeDetails,sanitizeDetails.exceptTools. - Shell minimizer:
shellMinimizer.enabled,shellMinimizer.only,shellMinimizer.except,shellMinimizer.maxCaptureBytes.
Maintainer notes are in DEVELOPMENT.md.