Tooluck logoTooluck
SKILL.md

context-audit

Agent skill fromundefined-ui/second-brain-os

Audit an agent's context layout against the four places: system prompt, tools, history, tail. Use when the user asks to audit, review or fix their agent's context, prompt caching, token spend per turn, or CLAUDE.md / AGENTS.md layout. Read-only: reports findings and a fix list, changes nothing. Do NOT use for writing evals (evals-bootstrap) or for loop design (goal-test).

How to install context-audit

install context-audit
# install the second-brain-os pack with the skills CLI
npx skills add undefined-ui/second-brain-os

# or add only this skill to Claude Code: copy the folder

plugins/agents-course/skills/context-audit/

# into

~/.claude/skills/context-audit/ (all projects)

.claude/skills/context-audit/ (one project)

plugins/agents-course/skills/context-audit/SKILL.md

MITFull file
1# Audit the context window
2
3Theory: [How models read context](https://secondbrainos.dev/#/read/course-1-context/how-models-read)
4and [The four places](https://secondbrainos.dev/#/read/course-1-context/the-four-places).
5Every piece of context belongs in exactly one of four places — a byte-stable
6system prompt, a frozen tool set, a compacting history, and a short live tail —
7and most agent problems trace back to something sitting in the wrong one.
8
9## Core rule
10
11Report and rank; never edit. The output is an audit, and the user decides
12what to apply. If they ask you to apply fixes afterwards, that is a normal
13edit session, not this skill.
14
15## Workflow
16
171. **Find the context sources.** Locate what actually reaches the model:
18 system prompt (or CLAUDE.md / AGENTS.md for a Claude Code setup), tool
19 definitions, and — if the project logs requests — one full mid-conversation
20 payload. If nothing is logged, say so and audit the static files; ask for
21 one captured request only if the user can produce it cheaply.
222. **Measure the five numbers.** Approximate token counts for: system prompt,
23 tool definitions, message history, retrieved content, current query.
24 A rough count (chars / 4) is fine; write all five down.
253. **Hunt cache killers.** Flag every dynamic value in the system prompt —
26 timestamps, user names, injected memories, "current task" lines. Each one
27 is a guaranteed cache miss on every call. Check whether the tool list can
28…

Excerpt shown under the repository's MIT license.

More skills in second-brain-os

Keep exploring

Similar skill repositories

Newsletter

Join the Community

Subscribe to our newsletter for the latest news and updates