context-audit — Claude Code skill: what it does, how to install
Scans agent instructions across CLAUDE.md, skills, and tools for conflicts and duplicates. Prepares a cut list as a diff to trim context size.
npx skills add Neeeophytee/finding-unknowns-skills --skill context-audit -a claude-codeWhat context-audit does
Models spend thinking budget resolving instructions before tackling your prompt. This skill audits every directive layer reaching the agent, including root and nested CLAUDE.md, AGENTS.md, hooks, and MCP tool descriptions. Because contradictions occur between layers, it evaluates all sources together.
The audit sorts rules into five distinct buckets: conflicts, duplicates, obvious defaults, broad judgement calls, and essential repository invariants. It prioritizes direct contradictions and redundancy for removal. Anything useful but rarely triggered gets recommended for relocation into an on-demand skill.
Safety comes first. The skill proposes diffs but never deletes lines on its own. Rules addressing past incidents stay intact until verified. Each report highlights before-and-after line counts alongside the single deletion with the lowest confidence score.
What it helps with
- identify direct contradictions between
CLAUDE.mdand MCP tool rules - remove duplicate guidance scattered across nested instruction files
- generate a diff to rightsize bloated agent context
- move occasional instructions into on-demand skills
Example prompts for the agent
- Run context-audit on this repository
- Audit CLAUDE.md and tool descriptions for contradictions
- Rightsize agent context and propose a cut list
How to install context-audit
1Skills CLI (Vercel)
npx skills add Neeeophytee/finding-unknowns-skills --skill context-audit -a claude-code2Manually: put the files in place
~/.claude/skills/context-audit/SKILL.mdCopy the whole skill folder; for one project use .claude/skills/context-audit/
1Skills CLI (Vercel)
npx skills add Neeeophytee/finding-unknowns-skills --skill context-audit -a codex2Manually: put the files in place
.agents/skills/context-audit/SKILL.mdFor all projects use ~/.agents/skills/
1Skills CLI (Vercel)
npx skills add Neeeophytee/finding-unknowns-skills --skill context-audit -a cursor2Manually: put the files in place
.cursor/skills/context-audit/SKILL.mdCursor also reads .agents/skills/ and .claude/skills/
1GitHub CLI
gh skill install Neeeophytee/finding-unknowns-skills context-audit2Manually: put the files in place
.github/skills/context-audit/SKILL.md1Skills CLI (Vercel)
npx skills add Neeeophytee/finding-unknowns-skills --skill context-audit -a gemini-cli2Platform CLI
gemini skills install https://github.com/Neeeophytee/finding-unknowns-skills --path skills/context-auditManually: put the files in place
.devin/skills/context-audit/SKILL.mdThe legacy .windsurf/skills/ path still works
Skills CLI (Vercel)
npx skills add Neeeophytee/finding-unknowns-skills --skill context-audit -a opencodeClaude.ai
Zip the folder and upload it in Settings → Capabilities → Skills
Step by step, with commands for each platform: How to install skills in Claude Code: five ways
Questions about context-audit
How to install context-audit in Claude Code?
Run npx skills add Neeeophytee/finding-unknowns-skills --skill context-audit -a claude-code in your terminal. You can also place the skill file directly at ~/.claude/skills/context-audit/SKILL.md.
What does context-audit do?
It reviews all instruction files and tool descriptions available to the model to uncover overlapping or contradictory rules. The output is a diff proposing specific lines to prune.
Does context-audit apply file changes automatically?
No, it strictly proposes deletions without modifying files directly. You review and approve every change, with the least certain recommendation explicitly highlighted.
Source text
SKILL.md · MIT
---
name: context-audit
description: Audit the instructions an agent already carries — CLAUDE.md, AGENTS.md, skills, tool descriptions — for contradictions, over-constraint, and duplication, then propose a cut list. Use when an agent ignores its own instructions, when a CLAUDE.md has grown bloated, or when the user asks to audit or rightsize their agent context.
---
# Context audit
A prompt is written for one task; context is reused across every task, so it can never be as specific. That gap is where instructions rot: rules written for a worst case that no longer happens, guidance duplicated across three layers, two layers quietly telling the model opposite things. The model can resolve all of it — by spending thinking budget on it before it starts your actual work. This skill finds what to delete.
## Steps
1. Inventory every layer that reaches the model: root and nested `CLAUDE.md`/`AGENTS.md`, each skill's description and body, hooks, tool and MCP server descriptions, and any harness prompt the user controls. Report each layer's size. The layer the user forgot they wrote is usually the loudest one.
2. Read them together, the way the model receives them — not one file at a time. Contradictions only exist between layers.
3. Classify every instruction as one of five things:
- **Conflict** — two layers pulling opposite ways ("document as appropriate" against "never add comments"). Quote both sides verbatim. These are the most expensive finding and go first.
- **Duplicate** — the same instruction in two places. Keep the copy nearest the point of use; behavior of a tool belongs in that tool's description, not in the global preamble.
- **Obvious** — restates what the file tree, the language, or the surrounding code already shows.
- **Judgement-now** — a blanket rule written to prevent a worst case, wrong for some real subset of requests, and the kind of call a current model makes well on its own.
- **Gotcha** — non-obvious, specific to this repo, load-bearing. This is what should survive; most repos are mostly the other four.
4. Propose the cut as a diff: conflicts resolved first, then duplicates, then the rest. For anything that is worth keeping but only sometimes needed, propose relocating it into a skill or a linked file loaded on demand rather than deleting it.
5. Close with before/after line counts and the single deletion you are least confident about, named explicitly so a human decides that one.
## Guardrails
- Propose, don't apply. The user approves every deletion.
- A rule that reads as over-constraint is sometimes scar tissue from a real incident. Anything naming a specific failure gets asked about, not cut.
- Judge instructions by whether they change behavior, not by whether they sound wise. A line the model already follows by default costs tokens to say nothing.
- If the harness ships its own rightsizing command, this runs alongside it, not instead of it.
- An audit that deletes a real invariant costs far more than the tokens it saved. When a line's purpose is unclear, that ambiguity is the finding — report it rather than guessing.
© Neeeophytee · MIT · Neeeophytee/finding-unknowns-skills