Skills

Context Audit

Token-hygiene audit of the always-loaded context stack, CLAUDE.md, AGENTS.md...

Install

npx skills add garrytan/gbrain --skill context-audit -g -a claude-code -y
Repository
garrytan/gbrain31.4k
Category
AI and agents
Updated
3d ago
License
MIT
Context cost
Mediumabout 2,896 tokens
Runs scripts
No, instructions only

What it does

Token-hygiene audit of the always-loaded context stack, CLAUDE.md, AGENTS.md, auto-memory MEMORY.md, and the bootstrap-rendered identity files (SOUL.md, USER.md, ACCESS_POLICY.md, HEARTBEAT.md) or their harness equivalents. Finds redundancy, contradictions, stale content, compression candidates, and skill-extraction candidates; produces a ranked action list sorted by token savings with a risk class per finding. REPORT-ONLY: this skill never edits any audited file. Recommendations for bootstrap-rendered files target the interview answer bank / templates, never the rendered output. Judging routes through `gbrain eval cross-modal` (single cheap model by default; full multi-model panel is explicit opt-in).

context-audit, Token Hygiene for the Always-Loaded Context Stack

Convention: see conventions/brain-first.md , before running a fresh audit, check the brain for prior audit reports (gbrain recall "context audit report") so you can compute token DRIFT since the last run and avoid re-flagging findings the user already declined.

Convention: see conventions/quality.md, > every finding cites its file and evidence; no unsourced claims.

What this is

Every file that loads on every turn is a per-turn tax: tokens, latency, and, past a point, instruction-following quality. Always-loaded files accrete (append-only release notes, promoted memory blocks nobody re-reads, rules restated in three files that drift into contradiction). This skill audits the whole always-loaded stack at once and returns a ranked, evidence-cited action list sorted by token savings.

It is an auditor, not a surgeon. It measures, finds, ranks, and recommends. The user (or a skill the user explicitly invokes afterward) applies changes.

Scope: what counts as "always-loaded"

Enumerate what THIS harness actually loads every turn, do not assume a fixed list. Typical stack:

FileRoleFix belongs in
project CLAUDE.md / AGENTS.mdorientation, routing, invariantsthe file itself (source-editable)
user-global CLAUDE.mdcross-project instructionsthe file itself (source-editable)
auto-memory MEMORY.mdpromoted memory blocksthe memory store (demote/expire)
SOUL.md, USER.md, ACCESS_POLICY.md, HEARTBEAT.md, rendered AGENTS.mdbootstrap-rendered identity filesthe interview answer bank / templates, NEVER the rendered file
harness system-prompt fragments (identity/tools files)per-harnesswherever that harness sources them
Read the whole SKILL.md on GitHub

More in AI and agents