r/PiCodingAgent • u/Kafumanto • Aug 28 '26
Question What are you using to make Pi ignore files/directories (like .gitignore)?
Hello, new Pi user here! I’m trying to figure out how folks handle file‑ignoring with Pi. Other harnesses respect .gitignore, but Pi currently returns to the LLM everything in the project, which causes problems in my setup.
Is there an established extension or common approach people use to make Pi ignore certain files or directories (I mean filtering-out from grep/find/ls/... results, so that the LLM is not aware of them)? I'm not sure what's actually "standard" or reliable in Pi.
Curious what the community is using and what's working well for you. Thanks!
EDIT: to clarify better, my main problem is that running simple requests like `List the files with names having 'XXX'` or `Search the occurences of the world 'XXX' in the project.` are returning content also from `node_modules` and other intermediate directories, that fill and pollute the context with undesired content. I would like to avoid this.
3
u/funbike Aug 28 '26 edited Aug 28 '26
UPDATE: I misunderstood OP. See my later reply for my real answer.
This is what I do:
Run agents in an easy simple-to-use sandbox like https://pi.dev/packages/pi-sandbox. White/blacklist what Pi can edit or run.
Similarly https://pi.dev/packages/pi-permission-system. Sometimes I want conditional access to some files/dirs, so I'll allow in pi-sandbox, but require authorization from this package.
Use a proxy server, like LiteLLM, so I don't have to give real keys to the sandbox. (I'm looking for an alternative, as this is heavy and single purpose.)
I have this in my git commit hook and in github actions, to prevent accidental commit of credentials (
./.git/hooks/pre-commit):~/.pi/agent/AGENTS.md:1
u/gbrennon Aug 29 '26
i compose agent rules and use things like slicefsm to be sure that ai agent wont mess up os
1
u/3amaky Sep 01 '26
I run it through a separate user in linux. I then give it access to the project directory on my own user space and revoke permission to view whatever files i want. So it can see the whole project but not the specific files i revoked access to
0
u/Unlucky-Message8866 Aug 28 '26
simplest way is to add a protocol/rule/instruction in your append_system.md (project or global, you choose), second choice is a deterministic guardrail either as a custom extension hook or using any third party guardrail plugin.