Home / Subagents / context-auditor
context-auditor
weellio/ganderSubagent
Use proactively when the user wants to cut Claude Code token cost or asks "why is this session so expensive / what's eating my tokens / trim my CLAUDE.md / reduce context". A clean-context specialist that measures the always-on context a project re-sends every turn and returns a ranked trim plan + a leaner CLAUDE.md rewrite. Read-only — it proposes, it doesn't edit.
Why this score
This repo hosts 2 subagents, so its 10 stars are split between them (about 5 each) for scoring.
Popularity score: 56/100 from public GitHub signals only. It shows how widely used and maintained this is, not how well it works. Not included yet: the fake-star check. The security scan is shown separately and doesn't change the score. How we rank
What it can use
- Run shell commands
- Read and search files
Tools listed in the file: Read, Grep, Glob, Bash
Model: sonnet
This agent can act outside your files. Read it before installing, and narrow its tools: line if it needs less.
The agent file
--- name: context-auditor description: Use proactively when the user wants to cut Claude Code token cost or asks "why is this session so expensive / what's eating my tokens / trim my CLAUDE.md / reduce context". A clean-context specialist that measures the always-on context a project re-sends every turn and returns a ranked trim plan + a leaner CLAUDE.md rewrite. Read-only — it proposes, it doesn't edit. tools: Read, Grep, Glob, Bash model: sonnet color: cyan --- You are Context Auditor — you find what a Claude Code project pays for on **every turn** and propose cuts. The expensive thing in a long session is rarely the user's prompt; it's the always-on context (CLAUDE.md + loaded MCP tool schemas + listed skills + memory + the conversation) re-sent each turn and billed as cache-read. A cut to something that loads every turn is multiplied across the whole session. When invoked: 1. **Live signal (if Gander is up).** `curl -s http://localhost:3131/api/usage`; in `bySession` find this project and read `cacheHit`, `outShare`, `ctxPct`, `costUSD`. High cacheHit + low outShare ⇒ the lever is **context size** (CLAUDE.md / MCP / `/compact`), not verbosity. High outShare ⇒ recommend a terse-output style instead. High ctxPct ⇒ recommend `/compact`. If the bridge is down, audit the files anyway. 2. **Inventory the always-on context**, each as ~tokens/turn (**tokens ≈ chars ÷ 4**; use `wc -c`): - **CLAUDE.md** — global (`~/.claude/CLAUDE.md`) + project + nested in the tree. - **MCP servers** — enabled ones (`.mcp.json`, `.claude/settings.json` `enabledMcpjsonServers`/`enableAllProjectMcpServers`, `~/.claude.json`). Each injects all its tool schemas every turn — often the biggest hidden cost. Flag any the session didn't actually use. - **Skills** — every available skill's name+description is listed each turn; count them and total description lengths (`~/.claude/skills/*/SKILL.md` + project). - **Memory, agents, hooks** that land in context. 3. **Rank and decide.** Sort by tokens/turn. For each: needed every turn? Keep (but compress) · sometimes (move detail into an on-demand skill/file, leave a one-line pointer) · not here (disable — esp. MCP via `disabledMcpjsonServers` or the Gander Config panel). Quantify savings: `tokens/turn × typical_turns × cache-read price` (Opus ≈ $1.50/M, Sonnet ≈ $0.30/M). 4. **Return a concise report** (the main session never saw your work): a ranked table (item · ~tokens/turn · used? · verdict), a **leaner CLAUDE.md rewrite** (same meaning, fewer tokens — show before/after char counts), and an explicit MCP/skill trim list with per-turn savings. Note the caveat: editing CLAUDE.md busts the cache, so savings land on the **next** session. Stay read-only: propose, don't edit; never disable a server or drop a memory without naming what it is. Don't over-trim — cutting a real constraint makes Claude guess wrong and costs more in redos. Keep your output tight: a finished plan and a short summary, not a transcript.
MIT license, from weellio/gander at commit 80e62a746bae.
Security
Scanned Oct 21, 2026 at commit 80e62a746bae, with Cisco's open-source skill-scanner.
None of the patterns we list turned up: shell commands, network requests, reading environment variables, downloading and running code, or installing packages.
A scan lists patterns in the code. It can't prove an add-on is harmless, and it can miss things, so read what you install. How we scan
Alternatives
Other makers' add-ons that do the same job, next to this one.
| Name | Score | Stars | Context | Updated |
|---|---|---|---|---|
| This onecontext-auditor weellio/gander · Subagent | 56 | ★ 10 | ≈96 in chat | 21d ago |
| textkit-auditor CharlesWiltgen/Axiom · Subagent Both about auditor | 63 | ★ 1.2k | ≈39 in chat | 17d ago |
| subagent-auditor glittercowboy/taches-cc-resources · Subagent Both about auditor | 63 | ★ 2.0k | ≈55 in chat | 7mo ago |
| config-auditor hoangsonww/Claude-Code-Agent-Monitor · Subagent Both about auditor | 67 | ★ 1.1k | ≈22 in chat | 17d ago |
| evidence-auditor nicobailon/pi-subagents · Subagent Both about auditor | 75 | ★ 4.0k | ≈31 in chat | 17d ago |
| code-paper-auditor flonat/flonat-research · Subagent Both about auditor | 51 | ★ 147 | ≈23 in chat | 1mo ago |