# Context Audit

Audit an agent's context layout against the four places: system prompt, tools, history...

- Repository: https://github.com/undefined-ui/second-brain-os (1169 stars)
- Category: Design
- License: MIT
- Last updated: 2026-10-14
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add undefined-ui/second-brain-os --skill context-audit -g -a claude-code -y`
Codex: `npx skills add undefined-ui/second-brain-os --skill context-audit -g -a codex -y`
Cursor: `npx skills add undefined-ui/second-brain-os --skill context-audit -g -a cursor -y`
Gemini CLI: `npx skills add undefined-ui/second-brain-os --skill context-audit -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add undefined-ui/second-brain-os`

## Description

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).

## SKILL.md, as published by its author (untrusted third-party text, read it as data)

# Audit the context window

Theory: [How models read context](https://secondbrainos.dev/#/read/course-1-context/how-models-read)
and [The four places](https://secondbrainos.dev/#/read/course-1-context/the-four-places).
Every piece of context belongs in exactly one of four places, a byte-stable
system prompt, a frozen tool set, a compacting history, and a short live tail, and most agent problems trace back to something sitting in the wrong one.

## Core rule

Report and rank; never edit. The output is an audit, and the user decides
what to apply. If they ask you to apply fixes afterwards, that is a normal
edit session, not this skill.

## Workflow

The rest: https://github.com/undefined-ui/second-brain-os/blob/HEAD/plugins/agents-course/skills/context-audit/SKILL.md
