@strayge/pi-builtin-tool-limits

Pi extension that applies fixed context limits to Pi's built-in tools.

Packages

Package details

extension

Install @strayge/pi-builtin-tool-limits from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@strayge/pi-builtin-tool-limits
Package
@strayge/pi-builtin-tool-limits
Version
0.0.2
Published
Oct 23, 2026
Downloads
268/mo · 41/wk
Author
strayge
License
MIT
Types
extension
Size
37.7 KB
Dependencies
0 dependencies · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./src/index.ts"
  ]
}

Security note

Pi packages can execute code and influence agent behavior. Review the source before installing third-party packages.

README

pi-builtin-tool-limits

A Pi extension that replaces five built-in tools with wrappers using fixed, context-safe output limits:

Tool Hard count limit Hard text limit Retention
read 1,000 lines 10 KiB Head
bash 1,000 lines 10 KiB Tail
grep 100 matches 10 KiB Head
find 200 results 10 KiB Head
ls 500 entries 10 KiB Head

grep also retains Pi's 500-character per-output-line cap. read keeps continuation notices and accurate offset values after either hard limit. When bash output is truncated, the complete raw stdout/stderr stream is saved to a unique pi-bash-*.log temporary file. The file is created only after a hard limit is crossed and is closed on every completion path.

Explicit limit arguments above a hard cap are reduced to that cap. Lower explicit limits remain unchanged. edit and write are not overridden.

The wrappers use Pi's public built-in tool definition factories, preserving schemas, path handling, image support, shell/search behavior, .gitignore handling, renderers, and result metadata. There is no configuration file and no compatibility package.

Install

pi install npm:@strayge/pi-builtin-tool-limits

Requires Node.js >=22.19.0 and pi >=1.0.2.

For development, load this checkout directly:

pi -e "$PWD/extensions/pi-builtin-tool-limits/src/index.ts"

Development

npm install
npm test
npm run check