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.
npx skills add FlorianBruniaux/claude-code-plugins --skill token-auditgit clone --depth 1 https://github.com/FlorianBruniaux/claude-code-pluginsWrote 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.
[](https://agentmods.dev/skills/florianbruniaux/claude-code-plugins/token-audit)<a href="https://agentmods.dev/skills/florianbruniaux/claude-code-plugins/token-audit"><img src="https://agentmods.dev/badge/skills/florianbruniaux/claude-code-plugins/token-audit/github.svg" alt="Measured on agentmods" height="20"></a>Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.
<a href="https://agentmods.dev/skills/florianbruniaux/claude-code-plugins/token-audit"><img src="https://agentmods.dev/badge/skills/florianbruniaux/claude-code-plugins/token-audit.svg" alt="Reviewed on agentmods" width="80" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00052 | $0.02441 |
| Opus 5.5 | $0.00021 | $0.00976 |
| Sonnet 5.5 | $0.00010 | $0.00488 |
| Haiku 4.5 | $0.00005 | $0.00244 |
Grade A, and why
token-audit scanned grade A with 1 finding 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 3d 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.
Reads agent configuration directorieslowAgent snooping
.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.
echo "=== RULES FILES (sorted by size) ===" && find .claude/rules -name "*.md" 2>/dev/null \ Downgraded: this mod is about security review, or the phrase is quoted, so it is likely naming the pattern rather than instructing it.
How it starts
The opening of the file, as written. The whole thing — 229 lines — stays where its author put it; the contents beside it link to each section on GitHub.
/token-audit: Context token audit
Purpose: Measure how many tokens your Claude Code configuration consumes before any user task begins. Identify the biggest sources of overhead. Produce a concrete action plan with savings estimates.
When to use:
- You're hitting rate limits before end of day
- Sessions feel slow or context compresses early
- You've added a lot of rules files and want to know the real cost
- After a major config change
What you will measure
| Component | Loaded when | Typical range |
|---|---|---|
~/.claude/CLAUDE.md + @imports |
Always | 5-15K tokens |
Project CLAUDE.md |
Always | 2-8K tokens |
.claude/rules/*.md without paths |
Always | 5-40K tokens |
MEMORY.md |
Always (first 200 lines or 25KB) | 1-3K tokens |
| Claude Code system prompt | Always | ~7,500 tokens |
Hook output (additionalContext, plain stdout of UserPromptSubmit and SessionStart hooks) |
Per matching event | variable |
| Skill and agent descriptions | Always (listing only) | small per item, adds up |
| Skill and agent bodies | On invocation only | 0 by default |
Key insight: .claude/rules/ loads every .md file without a paths field at session start, regardless of relevance. Skill and agent bodies are lazy-loaded (only their descriptions sit in context) and cost nothing more until invoked. Rules files are the most common source of unexpected overhead.
Step 1 — run the measurement
Execute these commands from the project root:
# Component sizes
echo "=== PROJECT CLAUDE.md ===" && wc -c CLAUDE.md 2>/dev/null || echo "none"
echo ""
echo "=== RULES FILES (sorted by size) ===" && find .claude/rules -name "*.md" 2>/dev/null \
| xargs wc -c 2>/dev/null | sort -rn | head -20
echo ""
echo "=== GLOBAL ~/.claude ===" && ls -la ~/.claude/*.md 2>/dev/null \
| awk '{print \$5, \$9}' | sort -rn
Then calculate the full budget:
# Rules without a `paths` field in their frontmatter (the ones loaded at session start)
always_loaded_rules() {
find -L "$@" -name "*.md" 2>/dev/null | while IFS= read -r f; do
awk 'NR==1 && !/^---$/{exit} NR>1 && /^---$/{exit} /^paths:/{found=1; exit} END{exit !found}' "$f" || cat "$f"
done
}
GLOBAL=$(cat ~/.claude/*.md 2>/dev/null | wc -c)
USER_RULES=$(always_loaded_rules ~/.claude/rules | wc -c)
PROJECT=$(wc -c < CLAUDE.md 2>/dev/null || echo 0)
RULES=$(always_loaded_rules .claude/rules | wc -c)
MEMORY=$(find ~/.claude/projects -name "MEMORY.md" 2>/dev/null \
| xargs grep -l "$(basename $(pwd))" 2>/dev/null | head -1 \
| xargs wc -c 2>/dev/null | awk '{print \$1}' || echo 0)
TOTAL=$(( GLOBAL + USER_RULES + PROJECT + RULES + MEMORY + 30000 ))
echo "Global ~/.claude : ~$(( GLOBAL / 4 )) tokens ($(( GLOBAL / 1000 ))K chars)"
echo "Project CLAUDE.md : ~$(( PROJECT / 4 )) tokens"
echo "Project rules (no paths field): ~$(( RULES / 4 )) tokens"
echo "User rules (no paths field) : ~$(( USER_RULES / 4 )) tokens"
echo "MEMORY.md : ~$(( MEMORY / 4 )) tokens"
echo "System prompt : ~7,500 tokens"
echo "---"
echo "TOTAL fixed context: ~$(( TOTAL / 4 )) tokens"
echo "% of 200K window : $(( TOTAL / 4 * 100 / 200000 ))%"
echo "NOT MEASURED: @imports. Add the size of each imported file to the total."
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.
- 3d ago Changed · +12 lines e149ed29488b
- 8d ago First seen · 217 lines · 52 tokens per session scan A da0d32fc68c1
token-audit is a skill published in the GitHub repository FlorianBruniaux/claude-code-plugins (48 stars, last pushed 3d ago), licensed MIT. It adds 52 tokens to every session and 2,441 once invoked, about $0.0002 per session on Opus 5.5. A static security scan graded it A with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-11-26.
token-audit compared with skills from other repositories
| Mod | Type | Stars | Last push | Licence | Scan | Tokens | Works with |
|---|---|---|---|---|---|---|---|
| token-auditFlorianBruniaux/claude-code-plugins | Skill | 48 | 3d ago | MIT | A | 52 | Claude Code |
| app-store-screenshotsfatihkan/badi | Skill | 8 | 2mo ago | MIT | A | 68 | Claude Code |
| contentfatihkan/badi | Skill | 8 | 2mo ago | MIT | A | 0 | Claude Code |
| expo-app-configfatihkan/badi | Skill | 8 | 2mo ago | MIT | A | 86 | Claude Code |
| expo-config-pluginfatihkan/badi | Skill | 8 | 2mo ago | MIT | A | 85 | Claude Code |
| expo-eas-buildfatihkan/badi | Skill | 8 | 2mo ago | MIT | A | 75 | Claude Code |
| expo-eas-submitfatihkan/badi | Skill | 8 | 2mo ago | MIT | A | 75 | Claude Code |