Guide · Agent skill
How to use the Context Stack Audit agent skill (context-audit)
Updated · written with AI from the project's own documentation and checked against our catalogue data
The context-audit skill is a tool for an AI coding agent that reviews the instruction files loaded into every conversation, such as CLAUDE.md, AGENTS.md and memory files. It reports where those files waste tokens, repeat themselves, contradict each other or are out of date. This guide explains what agent skills are, how to install this one, how to trigger it with plain requests and how to read its report.
Quick start
- 1Download and install. Download the ZIP from the directory page and unzip it into ~/.claude/skills/ or a project's .claude/skills/ folder, or upload it under Settings, Capabilities, Skills in the Claude apps.
- 2Confirm requirements. Make sure you have shell access and the gbrain CLI with configured model tiers. Check that gbrain config get models.tier.utility returns a model.
- 3Ask for an audit. Use a natural phrase such as context audit or audit my context stack. The agent will enumerate your always-loaded files.
- 4Review the measurements. Check the per-file byte and token counts and the divisor used. If your client reports an exact context breakdown, use that total instead.
- 5Read the ranked findings. Work through the findings sorted by token savings. Each row has a risk level and quoted evidence from the file.
- 6Apply changes yourself. The skill does not edit anything. Make the edits you choose, and for bootstrap-rendered files change the answer bank or template rather than the rendered output.
What an agent skill is and what context-audit does
An agent skill is a folder of instructions that an AI agent loads when it is relevant, so the agent knows how to do a specific job. The context-audit skill is defined in a single SKILL.md file.
Files such as CLAUDE.md and AGENTS.md load on every turn, which costs tokens, adds latency and can reduce how well the agent follows instructions as they grow. The skill reviews this always-loaded stack and checks six things: token efficiency, redundancy, contradictions, content that belongs in a skill, staleness and clarity.
- Finds the same rule stated in more than one file
- Finds conflicting rules, numbers or policies across files
- Finds outdated facts and references to removed features
- Returns a ranked list of suggested changes sorted by estimated token savings
- Attaches a risk level and cited evidence to each suggestion
Install the context-audit skill
You can install the skill in one of two ways. Download the ZIP from the directory page and unzip it into ~/.claude/skills/ to make it available to all your projects, or into a project's .claude/skills/ folder to limit it to that project.
You can also upload the skill in the Claude apps under Settings, then Capabilities, then Skills.
- Personal install: unzip into ~/.claude/skills/
- Project install: unzip into the project's .claude/skills/ folder
- Claude apps: Settings, Capabilities, Skills, then upload
Trigger the skill with natural requests
You do not need a special command. The skill responds to phrases such as context audit, context diet, system prompt audit, prompt compression, reduce context size, audit my context stack, context is too big and token hygiene. Asking in ordinary words that match these phrases is usually enough.
The skill's trigger list is written around these phrases, so using one of them makes it more likely the agent picks the skill up.
- My context is too big, can you audit my context stack?
- Run a context diet on this project's CLAUDE.md and AGENTS.md.
- Do a system prompt audit and tell me which files repeat each other.
- Find contradictions between my global CLAUDE.md and the project file.
Check what the audit needs before running it
The skill needs shell access so it can run wc and basic bash commands to measure file sizes. It also needs the gbrain CLI with configured model tiers, specifically gbrain eval cross-modal and gbrain config get models.tier.utility.
A brain store containing prior audit reports is optional. If you have one, the skill can compare token counts with the last run and show drift.
- Shell access for wc and basic bash
- The gbrain CLI with configured model tiers
- Optional: a brain store with prior audit reports for drift comparison
Read the report and apply changes yourself
The skill measures each file with wc -c and divides the byte count by 2.8 to estimate tokens. The report prints this divisor so you can recalculate every number. If your host client reports an exact per-category context breakdown, such as Claude Code /context, that figure takes priority over the estimate.
The skill is report-only. It never edits an audited file, even for zero-risk findings. Recommendations for bootstrap-rendered identity files target the interview answer bank or templates instead of the rendered output. Risk levels are green for zero risk, yellow for low risk and red for medium risk, and they tell you how carefully to apply each change.
- Green: pure deletion of exact redundancy or dead content
- Yellow: compression or skill extraction with a clear trigger
- Red: changes that could shift edge-case behavior
- Every rendered-file recommendation goes through the answer bank or template, not a direct edit
wc -c CLAUDE.md AGENTS.md SOUL.md USER.md ACCESS_POLICY.md HEARTBEAT.md MEMORY.mdSafety notes: scripts and network use
The skill runs scripts and uses the network. Its judging step sends the draft report through a model using gbrain eval cross-modal. By default this uses one cheap model from your utility tier with one cycle, which the source describes as costing a few cents.
A full multi-model audit runs a three-provider frontier panel and costs roughly three times or more per cycle. It runs only when you explicitly ask for a full or multi-model audit. The skill is designed not to make raw model API calls and not to hardcode model IDs.
- Default: one cheap utility-tier model, one cycle, a few cents
- Full panel: explicit opt-in only, about three times or more the cost per cycle
- No raw model API calls and no hardcoded model IDs
- Report-only, so the audit itself changes no files
What people use it for
- Trimming a long project CLAUDE.md that has grown with append-only release notes
- Finding rules repeated across a global CLAUDE.md, a project AGENTS.md and a memory file
- Spotting contradictions between overlapping instruction files in a team repository
- Reviewing bootstrap identity files such as SOUL.md and USER.md in the GBrain memory system
- Moving workflow-specific content out of always-loaded files into an on-demand skill
Frequently asked questions
Is context-audit free to use?
The skill is published under the MIT licence. Its default judging step calls one cheap utility-tier model, which the source estimates at a few cents per audit. A full multi-model audit costs roughly three times or more per cycle and runs only if you ask for it.
What do I need to run context-audit?
You need shell access to run wc and basic bash commands, and the gbrain CLI with configured model tiers. A brain store with prior audit reports is optional and only used for drift comparison.
Does context-audit edit my CLAUDE.md or AGENTS.md files?
No. The skill is report-only and never edits any audited file. It returns a ranked list of suggestions, and you apply any changes yourself.
How do I install a skill like context-audit?
Download the ZIP and unzip it into ~/.claude/skills/ for personal use or into a project's .claude/skills/ folder. In the Claude apps you can instead upload it under Settings, Capabilities, Skills.
Why is the token count only an estimate?
The skill divides the file's byte count by 2.8, a calibrated midpoint for Claude-family tokenizers on markdown. The report prints this divisor so you can check the numbers. If your client reports an exact context breakdown, that figure is used instead.
Is context-audit an alternative to manually trimming instruction files?
It is a helper for that job. It finds redundancy, contradictions, staleness and compression candidates and ranks them by estimated savings, but it does not clean anything up on its own, so the manual edits remain your responsibility.
New agent skills, repos and AI tools — every week
The best new skills and open-source projects, the fastest-growing repos, and one free prompt. Five minutes to read. Unsubscribe anytime.
Our verdict
Use context-audit if your agent feels slow or costly because of long always-loaded instruction files, or if your team maintains several overlapping CLAUDE.md or AGENTS.md files and needs to find conflicts. Skip it if you have no always-loaded context files, if you expect automatic cleanup, or if you do not want any model calls, since the judging step always sends the draft report through a model.
Download the skill