@the-agency/pi-tokenshrink

Reduce token usage of a Pi agent's conversation context using TokenShrink.

Package details

extension

Install @the-agency/pi-tokenshrink from npm and Pi will load the resources declared by the package manifest.

$ pi install npm:@the-agency/pi-tokenshrink
Package
@the-agency/pi-tokenshrink
Version
0.1.2
Published
Apr 16, 2026
Downloads
193/mo · 10/wk
Author
joshmock
License
MIT
Types
extension
Size
6.2 KB
Dependencies
1 dependency · 1 peer
Pi manifest JSON
{
  "extensions": [
    "./index.ts"
  ]
}

Security note

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

README

pi-tokenshrink

A Pi extension that uses tokenshrink to reduce token count of a prompt in a deterministic way that does not depend on LLM-based inference.

Install

pi install npm:@the-agency/pi-tokenshrink

Usage

Token reduction will be turned on automatically, and its status, plus an estimated count of saved tokens, will appear in the Pi status bar.

Commands:

  • /tokenshrink on: enable
  • /tokenshrink off: disable
  • /tokenshrink toggle: toggle between on and off