context-audit

context-audit is a skill for Claude Code, Codex from garrytan/gbrain. It costs 161 tokens per session (2,780 once invoked), scanned A, original, MIT.

An audit of files loaded into every agent conversation, such as instruction, identity, and memory files.

In plain words
What is it for?
Use it to review the always-loaded context stack and produce an evidence-based cleanup list.
Why use it?
It finds repeated, conflicting, outdated, or unnecessary text that consumes the agent's context space and can reduce instruction-following quality. It ranks findings by potential token savings but does not change files itself.

Skill for Claude CodeCodex

Part of the gbrain-coding plugin — 20 skills shipped together

About the project

GBrain is a memory and retrieval layer for AI agents that searches, connects, and synthesizes information from stored sources. It is used to give coding agents and autonomous agents access to knowledge beyond their current code, including shared company information with access controls. The catalogue add-ons help agents operate GBrain and connect it to agent workflows.

garrytan/gbrain · 29,539 stars · on GitHub

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/garrytan/gbrain/context-audit
Any agent
npx skills add garrytan/gbrain --skill context-audit
Clone the repo
git clone --depth 1 https://github.com/garrytan/gbrain

Made for: Claude Code, Codex.

Or install gbrain-coding, the plugin that ships this one along with the rest of its 20 skills.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for context-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/garrytan/gbrain/context-audit.svg)](https://agentmods.dev/skills/garrytan/gbrain/context-audit)
Your own site
<a href="https://agentmods.dev/skills/garrytan/gbrain/context-audit"><img src="https://agentmods.dev/badge/skills/garrytan/gbrain/context-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 161 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,780 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00161 $0.02780
Opus 5 $0.00081 $0.01390
Sonnet 5 $0.00032 $0.00556
Haiku 4.5 $0.00016 $0.00278

Measured 5d ago against content hash 6c811783349f, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

context-audit scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 5d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

plugin-variants/gbrain-coding/skills/context-audit/SKILL.md · 237 lines

How it starts

The opening of the file, as written. The whole thing — 237 lines — stays where its author put it; the contents beside it link to each section on GitHub.

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:

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

Skills, reference docs, and anything loaded on demand are OUT of scope as audit subjects — but they are the DESTINATION for skill-extraction findings (content that only matters for one workflow should move out of the always-loaded stack into a skill).

Read the full file on GitHub · 237 lines

Files

What ships with it

1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 5d ago First seen · 237 lines · 161 tokens per session scan A 6c811783349f

Subscribe to this mod's changes

context-audit is a skill published in the GitHub repository garrytan/gbrain (29,539 stars, last pushed yesterday), licensed MIT. It adds 161 tokens to every session and 2,780 once invoked, about $0.0008 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.

Related

Other skills, from other repositories

mem0-oss-to-platform

Plan and then execute a migration of a project from the mem0 open-source / self-hosted SDK (the local Memory class) to the mem0 Platform / hosted / managed SDK (the MemoryClient class). Use this whenever a developer wants to move, switch, or migrate their mem0 usage off OSS/self-hosted to the hosted API — e.g.…

mem0ai/mem0 · 273 tokens

Cortex

Operate Cortex, the LifeOS memory system — the typed Knowledge Archive (People, Companies, Ideas, Research with typed related: links) plus recall of prior work sessions, ISAs, and conversations. Search, add, harvest, develop, ingest, distill, graph-navigate, recall. USE WHEN cortex, knowledge, knowledge base, search…

danielmiessler/LifeOS · 196 tokens

agent-memory

../../../engineering/agent-memory/skills/agent-memory/SKILL.md.

alirezarezvani/claude-skills · 0 tokens

memory

Use when the user asks to remember, recall, forget, update, search, or inspect durable OpenSquilla memory, including profile facts in USER.md and long-term notes in MEMORY.md or memory//.md.

opensquilla/opensquilla · 44 tokens

ha-data-stores

Map of Hope Agent's local data stores and safe read-only query workflow. Use when the user asks where Hope Agent stores data, wants to inspect sessions/messages/memory/logs/background jobs/knowledge indexes/settings, asks the model to query local app data, or debugging requires checking persisted state. Trigger…

shiwenwen/hope-agent · 115 tokens

establishing-project-context

Use when the user asks to establish shared project language, or project work exposes a conflicting, renamed, or deprecated domain term that needs active semantic modeling. Routine small tasks stay on the fast path.

GanyuanRan/Aegis · 45 tokens