A repository is rarely worth reading in full. Infrastructure definitions, vendored dependencies, generated clients, fixtures carrying real customer names — none of it makes the AI better, and some of it you'd rather we never held at all. You can put any path off limits, and excluded files are never downloaded.
In Gleap, per repository — quickest, and nobody needs commit access. Or in a file in the repository itself, so the rules are versioned with the code and change when the code does.
Both apply at once. Where they disagree, Gleap's setting wins: a rule you set in the dashboard can't be undone by a commit.
Open Code Repositories, choose Edit on the repository, and fill in Excluded paths — one path per line. Kai Code repositories have the same field under Repositories in its settings.
Commit a .gleap/config.yaml to the root of the repository:
version: 1
# Off limits everywhere.
ignore:
- "infra/**"
- "**/*.env"
index:
# Only kept out of what the AI answers from.
ignore:
- "**/__fixtures__/**"
code:
# Only kept out of Kai Code sessions.
ignore:
- "scripts/deploy/**"The split is there because the two uses aren't the same. Test fixtures are noise in an answer but perfectly useful to a coding agent, so they belong under index rather than at the top. Anything genuinely sensitive belongs at the top, where it applies to everything.
If a list of paths is all you need, a .gleapignore file at the root works on its own.
Patterns work exactly like a .gitignore, so anything your team already writes there behaves the same here:
ignore:
- "secrets/" # the folder, wherever it appears
- "**/*.env" # every .env file, including at the root
- "packages/vendor/**" # everything under one package
- "!packages/vendor/README.md" # …except this one fileOne YAML quirk to watch: patterns starting with ! or * have to be quoted, or the file won't load.
An excluded file is never downloaded — not to build knowledge, not to answer a question, not into a Kai Code session. What Gleap holds is the list of paths a repository contains; the contents of excluded files stay with you.
Exclusions also apply backwards. If something was already indexed from a file you've now excluded, the next indexing run clears out what was derived from it.
The same file can carry context the code itself can't give — what the repository is for, who the documentation is aimed at, which parts are dead:
index:
instructions: |
This is the customer-facing dashboard.
Document the admin area only — everything under legacy/ ships to nobody.A few sentences here are worth more than they look. Naming and intent are the two things reading source code won't tell you.