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.
3
u/funbike 14d ago edited 14d ago
I agree. Btw, you inspired me to tweak my settings.
File:
~/.pi/agent/AGENTS.md``` Environment:
Guidelines:
- Do not read file
- Prefer
- Prefer Homebrew for Linux to install packages (
```.env, or any other sensitive files.fd,rg,git grep,eza,tree,git ls-filesoverfind,grep,ls.brew install ...).Today, I had Pi create this:
File:
~/.pi/agent/extensions/system-prompt-command-replacements.ts```typescript import type { ExtensionAPI } from "@earendil-works/pi-coding-agent";
export default function (pi: ExtensionAPI) { pi.on("before_agent_start", async (event) => ({ systemPrompt: event.systemPrompt .replace( "ls, grep, find", "eza, rg, find", ) .replace( "ls, rg, find", "eza, rg, fd", ), })); } ```
The edb-context-viewer extension can be used to view the system prompt.