ctx-ignore
Skill0 starsChanged 5 months agoMITView on GitHub
WHEN an agent keeps reading noise (node_modules, lockfiles, build output, generated code, fixtures) or a repo needs ignore files for AI tools. Triggers: 'generate a claudeignore', 'keep the agent out of X', 'my agent wastes context on generated files', 'set up ignore files', new repo onboarding. OUTPUT: a ranked noise report, an annotated .contextignore as source of truth, and tool-specific ignore files (.claudeignore, .cursorignore, .copilotignore, .windsurfignore). PAIR BEFORE: ctx-pack (exclude noise before assembling context). NOT FOR: choosing what to load for one task (use ctx-pack), .gitignore hygiene alone.
In this repository9 other files it gives its agents.
- AGENTS.mdAGENTS.md
- artifact-packagerSkill
- blindspot-passSkill
- ctx-packSkill
- decision-reviewSkill
- project-briefingSkill
- recall-prior-workSkill
- status-updateSkill
- ticket-scopingSkill
The file
We split this skill into the rules it gives an agent
5 rules. About 0 are common, 4 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈4
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 16
Write .contextignore as the annotated source of truth (grouped, commented, dated header), then derive the tool-specific files the user …
- Distinctive: line 17
If existing ignore files are present, merge additions under a marked section.
- Distinctive: line 28
Never exclude source, docs, or config that shapes runtime behavior, even when large.
- Distinctive: line 30
When unsure whether a directory is generated, check for a generator config or header comment before excluding it.
- Distinctive: line 32
Keep entries as directory or glob patterns, not hundreds of individual files.
≈ “Common” is an estimate: at least 1 in 5 of the 213,897 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
ctx-ignore
Decide what an agent should never read, once, instead of paying for the noise on every request. The other half of context assembly is context exclusion.
Workflow
- Walk the repo tree, respecting
.gitignore. Note file sizes. - Categorize noise candidates against
patterns.mdin this skill's directory (dependencies, lockfiles, build output, generated code, binaries, test artifacts, IDE/OS noise). Red entries always exclude; yellow entries (test files, migrations) need user confirmation. - Score each remaining candidate by context cost versus usefulness: large and mechanically produced ranks highest.
- Show a ranked report with a one-line reason per entry. Get confirmation before writing anything.
- Write
.contextignoreas the annotated source of truth (grouped, commented, dated header), then derive the tool-specific files the user wants:.claudeignore,.cursorignore,.copilotignore,.windsurfignore. - If existing ignore files are present, merge additions under a marked section. Never clobber hand-written entries.
Output Shape
- Ranked noise report: path, size, category, one-line reason
.contextignore(source of truth)- Tool-specific ignore files derived from it
- Skipped-on-purpose list: things that looked like noise but stay readable, with reasons
Rules
- Never exclude source, docs, or config that shapes runtime behavior, even when large.
- Lockfiles are noise for reading but load-bearing for reproducibility: exclude from agent context, never delete.
- When unsure whether a directory is generated, check for a generator config or header comment before excluding it.
- Report first, write second. No silent writes: wait for the user's explicit go-ahead on the report before writing any file, even when the change looks obviously right or you are fixing drift from a previous run.
- Keep entries as directory or glob patterns, not hundreds of individual files.
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

