Context Audit
A read-only audit that maps your agent's context window onto four places — system prompt, tools, history, tail — and ranks fixes by tokens saved per turn.
Dev & CodingIntermediate★ 815⑂ 128AI score 8/10Last updated: Sep 29, 2026
What it does
- Locates what actually reaches the model: system prompt (or CLAUDE.md / AGENTS.md), tool definitions, message history, and a captured request payload if one exists.
- Estimates five token counts (system prompt, tools, history, retrieved content, current query) using a rough chars/4 method.
- Hunts cache killers: timestamps, user names, injected memories, "current task" lines, and tool lists that mutate mid-run and invalidate the whole prefix.
- Hunts window bloat: the largest history item, verbatim tool results over ~2,000 tokens, and tool counts past ~20 (recommends deferred tools + tool search).
- Checks whether the goal only exists in the opening message and belongs restated in the live tail.
- Strictly report-only: it never edits files, just outputs a ranked fix list.
Who it's for
- Teams watching per-turn token spend creep upward
- Anyone puzzled by low prompt-cache hit rates
- Developers whose CLAUDE.md / AGENTS.md has grown into pages of narrative
- Engineers designing or operating LLM agent loops
Examples
- "Audit my agent's context" → a four-line token table plus ordered top fixes with file/line references.
- "Why does prompt caching always miss?" → it flags each dynamic value in the system prompt and where it should move instead.
- "Is my CLAUDE.md too long?" → it strips anything the repo already records and keeps only constraints the code cannot show.
· · · Install guide · · ·
Try it now, no install
Paste this into Claude to use the skill without installing anything.
Read the instructions in this file and follow them to help me: https://raw.githubusercontent.com/undefined-ui/second-brain-os/HEAD/plugins/agents-course/skills/context-audit/SKILL.md What I want: (describe your task here)
If Claude can't open the link, open it yourself and paste the contents instead.
↓ If it works for you, download the ZIP below and install it. Then it runs on its own — no pasting each time.
Install in the Claude app (no terminal)
- Download the ZIP with the button below.
- In Claude, open Settings → Capabilities and turn on 'Code execution and file creation'. (one time)
- Go to Customize → Skills → + → 'Upload a skill' and upload the ZIP.
Install in Claude Code
Let Claude do it — paste this into Claude Code
Install the skill I found on Claude Skill Mart. Copy the plugins/agents-course/skills/context-audit folder from the GitHub repo undefined-ui/second-brain-os into my ~/.claude/skills/context-audit/. When it's done, tell me in one line what this skill can do.
Install with a command instead
git clone https://github.com/undefined-ui/second-brain-os.git /tmp/second-brain-os && mkdir -p ~/.claude/skills && cp -r /tmp/second-brain-os/plugins/agents-course/skills/context-audit ~/.claude/skills/⚠ This is a third-party skill. Check the source repository before installing.
- Open a terminal.
- Clone the repository:
git clone https://github.com/undefined-ui/second-brain-os.git - Create the skills directory:
mkdir -p ~/.claude/skills - Copy the skill:
cp -r second-brain-os/plugins/agents-course/skills/context-audit ~/.claude/skills/ - Verify that
~/.claude/skills/context-audit/SKILL.mdexists. - Restart Claude Code and ask something like "audit my agent's context window".
- Remember the output is a report — apply the recommended fixes yourself in a separate editing session.
View source on GitHub ↗License: MIT