strip-pi-docs
v1.0.1
Published
Pi extension that strips the built-in Pi documentation pointer from the system prompt
Maintainers
Readme
strip-pi-docs
Pi extension that removes the built-in Pi documentation pointer from the system prompt.
By default, every Pi session injects a block like:
Pi documentation (read only when the user asks about pi itself, its SDK, extensions, themes, skills, or TUI):
- Main documentation: …
- Additional docs: …
- Examples: …
…That block is useful when hacking on Pi itself, but otherwise burns context every turn. This extension strips it.
Install
pi install npm:strip-pi-docsOr try without installing:
pi -e npm:strip-pi-docsRequires Pi 1.2.0 or later and Node.js 22.19.0 or later.
Usage
Stripping is on by default. Preference is stored in:
~/.pi/agent/strip-pi-docs.jsonSlash command:
| Command | Effect |
|---|---|
| /strip-pi-docs | Show status (this session + next session) |
| /strip-pi-docs status | Same |
| /strip-pi-docs on | Enable stripping for new sessions |
| /strip-pi-docs off | Disable stripping for new sessions |
| /strip-pi-docs toggle | Flip the pending preference |
Important: /strip-pi-docs on|off|toggle only updates the saved preference. The current session keeps the setting it had at session_start. Start a new session (/new, /clear, or restart Pi) to apply the change.
How it works
- On
session_start, the extension snapshotsenabledfrom the config file. - On each
before_agent_start, if enabled, it replacesevent.systemPromptOptions.sections.docswith a newline. Pi rebuilds the system prompt with an empty documentation section.
Forced system prompts are left unchanged. Custom prompts without a documentation section are also left unchanged.
Config
{
"enabled": true
}Override the config path with STRIP_PI_DOCS_CONFIG (useful for tests).
Development
Run these commands from the repository root:
npm ci
npm run check --workspace=strip-pi-docsMaintainer releases
See RELEASING.md for versioning, package tags, and npm trusted publishing.
License
MIT
