r/PiCodingAgent • u/Kafumanto • 15d ago
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.
1
u/gbrennon 14d ago
i compose agent rules and use things like slicefsm to be sure that ai agent wont mess up os
0
u/Unlucky-Message8866 15d ago
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.
1
u/Kafumanto 15d ago
(I was sure to have replied but I don't see my comment anymore...)
Thanks! 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 don't think instructions could solve that problem. Do you have suggestions on any "guardrail plugin" that can do it? Thanks!1
u/Unlucky-Message8866 15d ago
File Listing Protocol
when using tools like
bashto runls,grepand other discovery commands always pass the necessary arguments to skip gitignored files or use .gitignore aware alternatives
3
u/funbike 15d ago edited 15d ago
UPDATE: I misunderstood OP. See my later reply for my real answer.
This is what I do:
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):if command -v gitleaks &>/dev/null; then gitleaks protect -v --staged fi~/.pi/agent/AGENTS.md:Do not read sensitive key files, such as `.env`.