Install
Install with PiG
pig install npm:@bacnh85/pi-rtkInstall with Pi
pi install npm:@bacnh85/pi-rtkReview 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": [
"./extensions/index.ts"
]
}README
Written by the package's publisher, shown as published in version 0.2.8 (README.md). PiG does not review it.
@bacnh85/pi-rtk
Pi extension that rewrites bash tool calls through RTK for token savings.
Behavior
- Listens for Pi
tool_callevents for the built-inbashtool. - Listens for context-visible user shell commands entered as
!cmd. - Skips
!!cmduser shell commands because their output is excluded from model context. - Delegates command matching to
rtk rewrite. - Mutates agent bash commands in place or wraps user shell execution when RTK returns a rewrite.
- Falls back to native
findwhen RTK would rewrite to unsupported compound/actionrtk findpredicates. - Fails open on errors: commands pass through unchanged.
- Caches RTK-unavailable state briefly to avoid repeatedly probing a missing binary.
- Does not block, confirm, audit, or permission-gate commands.
Commands
/rtk enableenables rewrites for the current Pi session./rtk disabledisables rewrites for the current Pi session./rtk statusshows session state, cache state, and detected RTK details./rtkshows status.
Requirements
rtk >= 0.23.0available inPATH;rtk >= 0.46.0recommended — from 0.46, find predicates like-not/-or/-mtime/-size/-newer/-perm/-emptyand( … )groups rewrite too (rtk passes unmodeled predicates through to real find). Older rtk keeps working with a stricter find blocklist.- Set
RTK_DISABLED=1to bypass rewrites (read from the process environment only).
Install
pi install npm:@bacnh85/pi-rtk
Changelog
See CHANGELOG.md for release history.
Test
node --test extensions/test/*.test.js