@cpzombie/pi-tool-limit-bumper
v1.0.0
Published
pi coding agent extension: raises the hardcoded tool output limits (50KB/2000 lines) and re-applies the patch automatically after pi updates
Readme
@cpzombie/pi-tool-limit-bumper
pi coding agent extension that raises pi's hardcoded tool output limits and keeps them raised.
pi hardcodes a 50KB / 2000-line output limit in its read/bash/
grep/find/ls tools. This extension patches the installed pi package
(constants only — no tool logic) to larger limits, and re-checks on every
session start, so a pi update never silently regresses the limits.
Defaults: 100KB / 4000 lines.
Install
pi install npm:@cpzombie/pi-tool-limit-bumper
# or pinned to a version:
pi install npm:@cpzombie/[email protected]Uninstall:
pi remove npm:@cpzombie/pi-tool-limit-bumperConfiguration
Limits are chosen with the following precedence (highest first):
- Env vars —
PI_TOOL_LIMIT_KB=150 PI_TOOL_MAX_LINES=6000 pi(non-interactive runs, per-session overrides, CI) - Saved choice — the value you picked via the first-boot prompt or
the
/tool-limitcommand, stored in~/.pi/agent/pi-tool-limit-bumper.json - First-boot prompt — on the first TUI/RPC session where nothing is configured yet, pi asks once: Tool output limit (KB) and Max output lines (Esc keeps the default). The answer is saved for future sessions.
- Default — 100KB / 4000 lines
Change the limits at any time with the /tool-limit command:
Set new limits, Show current, or Reset to defaults.
Note: the patch is applied from pi's stock limits (50KB / 2000 lines).
If pi is currently patched to a different value than your setting, the
extension leaves the package alone and tells you to update or reinstall pi
(e.g. pi update) — once the files are back to stock, your saved limits
are applied automatically on the next start.
Also available:
PI_TOOL_LIMIT_PKG_DIR=/path/to/pi-package pi # pin a specific installBehavior
On every session start:
- already patched → silent no-op
- unpatched + writable → patches, notifies "restart pi to activate" (the running process already has the old code in memory)
- unpatched + not writable (typical after a root
npm i -g) → notifies with the exactchmod -R a+w <pi package dir>command needed - constants unrecognized (upstream refactor) → notifies an error and never touches files it doesn't understand
If a future pi release refactors the constants, the extension surfaces a clear error instead of half-patching.
Notes
- Why patch files instead of overriding the tools? The public tool
factories (
createReadTool,createBashTool, …) have no truncation options, and thetool_resulthook fires after truncation — the built-in limits are only reachable by patching the installed package. - Extension is TypeScript, loaded by pi via jiti — no build step.
@earendil-works/pi-coding-agentis a peer dependency provided by your pi installation; it is not bundled here.
