Skip to content

Context Stack Audit

Audits always-loaded agent context files for token bloat, redundancy and contradictions, with a ranked report

Repository
garrytan/gbrain
Stars
31,447
Licence
MIT
Files
1 file

What it does

Makes the agent review the instruction files that load into every conversation (such as CLAUDE.md, AGENTS.md and memory files) and report where they waste space, repeat themselves, contradict each other, or are out of date. It returns a ranked list of suggested changes sorted by estimated token savings, each with a risk level and cited evidence. It is report-only: it does not edit any file, and the user applies any changes.

Great for

  • Developers whose agent setup feels slow or expensive because of very long always-loaded instruction files
  • Teams maintaining several overlapping CLAUDE.md or AGENTS.md files who want to find conflicts
  • Users of the GBrain memory system who want to review their bootstrap identity files without editing rendered output directly

Skip it if

  • Projects with no always-loaded context files, since there is nothing for it to audit
  • Anyone expecting automatic cleanup: the skill only recommends, and applying changes is manual, so it will not fix anything on its own
  • Users who do not want model calls: the judging step sends the draft report through a model via gbrain eval cross-modal, which costs a few cents by default

Try asking

  • “Run a context audit on my project's CLAUDE.md and AGENTS.md and rank the cuts by token savings”
  • “My context is too big, find redundancy across my instruction files”
  • “Compare my memory file against last audit and show token drift”
  • “Do a full multi-model context audit of my stack”
Step-by-step guide: how to use Context Stack AuditInstall, first run, examples, tips and FAQs

Install in 3 steps

  1. 1

    Download the skill

    The ZIP contains the 1 original files, the MIT licence and an attribution note.

    context-audit.zip
  2. 2

    Add it to your agent

    Claude Code (all projects)

    mkdir -p ~/.claude/skills && unzip context-audit.zip -d ~/.claude/skills/

    Claude Code / Agent SDK (this project only)

    mkdir -p .claude/skills && unzip context-audit.zip -d .claude/skills/

    Claude apps (web/desktop): Settings → Capabilities → Skills → Upload skill, and choose the ZIP.

  3. 3

    Ask for the task

    No special command needed — the agent reads the skill's description and loads it when your request matches. Try one of the prompts above.

Get better results

  • Ask for the default single-model judge first; request a full multi-model audit only when you need it, since it costs roughly three times as much
  • If you use Claude Code, run /context and quote its exact numbers, because the skill prefers exact host figures over its byte-based estimate
  • Review the 🔴 medium-risk findings carefully, since they may change edge-case agent behaviour

What's inside

  • SKILL.md

Redistributed unmodified from garrytan/gbrain under the MIT licence. The assessment was drafted with AI from the skill's files on 2026-10-29. Skills can instruct your agent to run code — read SKILL.md and any scripts before installing.