# Context Audit

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

- Repository: https://github.com/garrytan/gbrain (31427 stars)
- Category: AI and agents
- License: MIT
- Last updated: 2026-11-01
- Runs scripts: no, instructions only

## Install

Claude Code: `npx skills add garrytan/gbrain --skill context-audit -g -a claude-code -y`
Codex: `npx skills add garrytan/gbrain --skill context-audit -g -a codex -y`
Cursor: `npx skills add garrytan/gbrain --skill context-audit -g -a cursor -y`
Gemini CLI: `npx skills add garrytan/gbrain --skill context-audit -g -a gemini-cli -y`
Claude Code plugin marketplace: `/plugin marketplace add garrytan/gbrain`

## Description

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

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

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

> **Convention:** see [conventions/brain-first.md](../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](../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:

| File | Role | Fix belongs in |
|---|---|---|
| project `CLAUDE.md` / `AGENTS.md` | orientation, routing, invariants | the file itself (source-editable) |
| user-global `CLAUDE.md` | cross-project instructions | the file itself (source-editable) |
| auto-memory `MEMORY.md` | promoted memory blocks | the memory store (demote/expire) |
| `SOUL.md`, `USER.md`, `ACCESS_POLICY.md`, `HEARTBEAT.md`, rendered `AGENTS.md` | bootstrap-rendered identity files | the interview answer bank / templates, NEVER the rendered file |
| harness system-prompt fragments (identity/tools files) | per-harness | wherever that harness sources them |

The rest: https://github.com/garrytan/gbrain/blob/HEAD/plugin-variants/gbrain-coding/skills/context-audit/SKILL.md
