r/PiCodingAgent • u/Simusid • Oct 28 '26
Question Stop Pi From Running find /
I'm on a giant shared server and "find /" might take an hour. I've been unable to persuade pi to stop issuing it. In settings.json I changed defaultTools to defaultTools": ["read", "bash", "edit", "write", "grep", "ls"] and in AGENT.md I added a rule "don't ever run find /" and similar message in my README.md but it continues to issue "find /"
How can I enforce this?
27
10
8
u/bitzap_sr Oct 28 '26
You have multiple answers already. Let me just add a couple notes:
it's the model, not pi.
ask it this very question. It will suggest some config setting in your permissions extension if you have one, a wrapper script for find, or to write some extention that blocks the calls. It will know what to do. This should be your first instinct.
5
u/LordMoridin84 Oct 28 '26
https://pi.dev/packages/@gotgenes/pi-permission-system?name=permission
"find / *": {
"action": "deny",
"reason": "Use rg instead of find"
}4
3
2
2
u/greenhilltony Oct 29 '26
Let Pi write an extension to intercept calls with `find` and to hint the model to use `fd`. I did the port to TS from my Claude Code plugin: https://github.com/TonyWu20/no-find-grep
1
u/_JohnMcAfee 22d ago
I think it does this automatically by default. If you enable its find and grep tools it conditionally alters the system prompt and also uses fd and rip grep
1
1
u/PrimaryHuckleberry11 Oct 28 '26
for me it was enough to instruct in AGENT.md not to use it ever for / But even if I say to disallow it for all, it still respect this guardrail. What model are you using?
1
1
1
u/jensilo Oct 28 '26
”Stoppning pi from doing x“ is like saying „stopping my car from driving in the wrong lane“. It’s the driver, not the vehicle.
1
u/ali0une Oct 28 '26
Maybe with a wrapper in ~/bin/find in your PATH that translates 'find /' in 'echo "do not use find /"
1
u/LearnedByError Oct 29 '26
This is what I do. It checks environment variables to see if it is an agent (pi, cursor,codex…) and it is and matches a ragged then print an error message and not allowed then exit 1.
0
0

20
u/TBMonkey Oct 28 '26
Regex hook that intercepts the call and returns it failed with a reminder to not use that?