@baggiiiie/pi-rtk-rewrite
A pi package that rewrites `bash` tool calls through [RTK](https://github.com/rtk-ai/rtk) before execution.
Package details
Install @baggiiiie/pi-rtk-rewrite from npm and Pi will load the resources declared by the package manifest.
$ pi install npm:@baggiiiie/pi-rtk-rewrite- Package
@baggiiiie/pi-rtk-rewrite- Version
0.0.2- Published
- May 4, 2026
- Downloads
- 101/mo · 15/wk
- Author
- baggiiiie
- License
- unknown
- Types
- extension
- Size
- 10.3 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
@baggiiiie/pi-rtk-rewrite
A pi package that rewrites bash tool calls through RTK before execution.
If RTK can optimize a command, pi transparently changes commands like:
git status
into:
rtk git status
That usually cuts token-heavy shell output by a lot, especially for git, rg, find, tests, builds, and similar commands.
Install
pi install /path/to/pi-stuff/packages/rtk-rewrite
Or after publishing:
pi install npm:@baggiiiie/pi-rtk-rewrite
Requirements
Install RTK separately and make sure rtk rewrite works in your shell:
brew install rtk
# or
curl -fsSL https://raw.githubusercontent.com/rtk-ai/rtk/refs/heads/master/install.sh | sh
rtk rewrite "git status"
Usage
Once installed, restart pi or run /reload.
/rtk-rewrite
/rtk-rewrite status
/rtk-rewrite on
/rtk-rewrite off
/rtk-rewrite refresh
/rtk-rewrite test git status
Environment knobs
PI_RTK_REWRITE_ENABLED=1
PI_RTK_REWRITE_TIMEOUT_MS=2000
PI_RTK_REWRITE_VERBOSE=0
PI_RTK_REWRITE_SHOW_STATUS=1
Notes
- This only rewrites pi
bashtool calls. - pi built-in tools like
read,edit, andwritedo not go through RTK. - The extension never blocks the original bash command if RTK fails or has no rewrite.