pi-repeat-tool-guard
v0.1.0
Published
Pi extension that appends system reminders to repeated tool call results.
Maintainers
Readme
pi-repeat-tool-guard
Reduce repeated tool calls in Pi.
pi-repeat-tool-guard is a Pi package for people who see the model repeatedly
calling the same tool with the same arguments. It keeps your normal Pi workflow
unchanged, but gives the model a clear reminder when it appears to be stuck in
that loop.
Use it when you want Pi to:
- notice repeated read/search/shell-style calls,
- reconsider the latest tool output before trying again,
- choose a different approach instead of burning turns on the same call.
Install
Install it globally for your Pi user:
pi install npm:pi-repeat-tool-guardInstall it only for the current project:
pi install npm:pi-repeat-tool-guard -lIf you are installing from the GitHub repository instead of npm:
pi install git:[email protected]:Kingwl/pi-repeat-tool-guardUse
After installation, start Pi normally:
piPi loads installed packages automatically. You can confirm the package is active from Pi's startup header or by running:
pi listConfiguration
The default behavior works without configuration. By default, the package starts
reminding the model after repeated identical calls at counts 3, 5, and 8.
You can adjust the repeat counts:
PI_REPEAT_TOOL_GUARD_THRESHOLDS=3,5,8 piTrack only selected tools:
PI_REPEAT_TOOL_GUARD_INCLUDE=read,grep,glob piIgnore selected tools:
PI_REPEAT_TOOL_GUARD_EXCLUDE=bash,write,edit pi* can be used as a wildcard in include/exclude values:
PI_REPEAT_TOOL_GUARD_INCLUDE='mcp__*,read,grep' piManaging The Package
Update installed Pi packages:
pi update --extensionsDisable, enable, or inspect installed extensions:
pi configRemove the package:
pi remove npm:pi-repeat-tool-guardNotes
This package does not reject tool calls and does not ask for extra user confirmation. The tool still runs normally; the model simply receives an extra reminder when it repeats itself.
It is designed as a lightweight Pi extension that you can install, keep enabled, and forget about until a repeated-tool loop shows up.
Reference
This package is inspired by Kimi Code's repeated tool-call protection:
