Context Audit
A read-only skill that audits an agent's context against four places — system prompt, tools, history, tail — and ranks fixes by tokens saved per turn.
Dev & CodingIntermediate★ 1,603⑂ 273AI score 8/10Last updated: Nov 3, 2026
What it does
Sorts everything that actually reaches the model into exactly one of four places: a byte-stable system prompt, a frozen tool set, a compacting history, and a short live tail.
- Estimates five token numbers: system prompt, tool definitions, message history, retrieved content, current query
- Hunts cache killers — timestamps, usernames, injected memories, "current task" lines in the prefix
- Flags window bloat: largest history item, verbatim tool results over ~2,000 tokens, more than ~20 tools or ~10K tokens of definitions
- Checks whether the current goal is stranded in the weak middle of the window
- Reviews CLAUDE.md / AGENTS.md for narrative bloat the repo already shows
- Read-only: it reports and ranks, never edits
Who it's for
- Teams running Claude Code or custom agents whose per-turn token spend keeps climbing
- Anyone fighting low prompt-cache hit rates and spiky latency/cost
- Repo maintainers whose CLAUDE.md / AGENTS.md has grown into pages of prose
- Builders whose agents drift off-goal in long conversations
Examples
- "Audit my agent's context" → four-line token table plus an ordered fix list with estimated savings per turn
- "Why isn't prompt caching working?" → names the timestamp in the system prompt and the tool list that mutates mid-run
- "Clean up our CLAUDE.md" → strips structure/history the repo already records, keeps only constraints the code can't 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 AI 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 repo:
git clone https://github.com/undefined-ui/second-brain-os.git - Create the skills folder:
mkdir -p ~/.claude/skills - Copy the skill:
cp -r second-brain-os/plugins/agents-course/skills/context-audit ~/.claude/skills/ - Verify
~/.claude/skills/context-audit/SKILL.mdexists. - Restart Claude Code and ask: "Audit this agent's context window."
- The output is a report only — request the specific fixes you want applied in a separate editing session.
View source on GitHub ↗License: MIT