token-audit

token-audit is a skill for Claude Code from FlorianBruniaux/claude-code-plugins. It costs 52 tokens per session (2,441 once invoked), scanned A, original, MIT.

A configuration audit that measures the context tokens Claude Code uses before your task starts. It identifies which instruction files, hooks, memory, and agent or skill listings contribute most.

In plain words
What is it for?
Use it after major configuration changes or when you need a prioritized plan for reducing fixed context overhead.
Why use it?
It helps explain rate-limit problems, early context compression, or slow sessions caused by too much always-loaded configuration.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter. Also seen: reads .claude/ paths; mentions CLAUDE.md; positional $N argument.

Part of the session-tools plugin — 8 skills, 1 agent, 1 plugin shipped together

Good fit Use it after major configuration changes or when you need a prioritized plan for reducing fixed context overhead.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/florianbruniaux/claude-code-plugins/token-audit
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.

Any agent
npx skills add FlorianBruniaux/claude-code-plugins --skill token-audit
Clone the repo
git clone --depth 1 https://github.com/FlorianBruniaux/claude-code-plugins

Made for: Claude Code.

Or install session-tools, the plugin that ships this one along with the rest of its 8 skills, 1 agent, 1 plugin.

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 token-audit

README.md
[![agentmods](https://agentmods.dev/badge/skills/florianbruniaux/claude-code-plugins/token-audit/github.svg)](https://agentmods.dev/skills/florianbruniaux/claude-code-plugins/token-audit)
Your own site
<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.

agentmods 80×15 button for token-audit

Your own site · 80×15
<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>
Per session 52 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 2,441 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 1 finding. A grade says what 26 rules found in the file — not that it is safe.
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.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

Measured 3d ago against content hash e149ed29488b, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

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.

plugins/session-tools/skills/token-audit/SKILL.md · 229 lines

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

Read the full file on GitHub · 229 lines

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. 3d ago Changed · +12 lines e149ed29488b
  2. 8d ago First seen · 217 lines · 52 tokens per session scan A da0d32fc68c1

Subscribe to this mod's changes

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.

Related

token-audit compared with skills from other repositories

token-audit next to 6 skills from other repositories
ModTypeStarsLast pushLicenceScanTokensWorks with
token-auditFlorianBruniaux/claude-code-pluginsSkill483d agoMITA52Claude Code
app-store-screenshotsfatihkan/badiSkill82mo agoMITA68Claude Code
contentfatihkan/badiSkill82mo agoMITA0Claude Code
expo-app-configfatihkan/badiSkill82mo agoMITA86Claude Code
expo-config-pluginfatihkan/badiSkill82mo agoMITA85Claude Code
expo-eas-buildfatihkan/badiSkill82mo agoMITA75Claude Code
expo-eas-submitfatihkan/badiSkill82mo agoMITA75Claude Code