← Catalog

@strayge/pi-builtin-tool-limits

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

Extension

Install

Install with PiG

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

Install with Pi

pi install npm:@strayge/pi-builtin-tool-limits
Review before installing

Packages run code with your permissions and influence agent behavior. Catalog inclusion is not a security audit. Review the source before installing a third-party package.

Pi manifest JSON

The pi field of package.json.

{
  "extensions": [
    "./src/index.ts"
  ]
}

README

Written by the package's publisher, shown as published in version 0.0.2 (README.md). PiG does not review it.

pi-builtin-tool-limits

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

ToolHard count limitHard text limitRetention
read1,000 lines10 KiBHead
bash1,000 lines10 KiBTail
grep100 matches10 KiBHead
find200 results10 KiBHead
ls500 entries10 KiBHead

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