ctxharness: Skill for Claude Code

.claude/skills/token-audit/SKILL.md

token-audit is a skill for Claude Code from FlorianBruniaux/ctxharness. It costs 39 tokens per session (1,248 once invoked), scanned A, original, MIT.

A configuration audit for Claude Code, the coding assistant, that measures how much of its context is used by instructions and rules before your task starts. It identifies which files create that overhead.

In plain words
What is it for?
Use it to inspect CLAUDE.md files, rule files, memory, and other startup instructions, then estimate possible token savings and decide what to shorten or reorganize.
Why use it?
Large instruction files can make sessions slower and cause the assistant to forget earlier details sooner. This audit shows where the overhead comes from and gives a prioritized plan to reduce it.

Skill for Claude Code

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

This is FlorianBruniaux/ctxharness's own configuration. It tells Claude Code how to work on ctxharness itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything ctxharness configures →

Reuse

Borrowing it

Nothing to install: this file belongs to FlorianBruniaux/ctxharness. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/FlorianBruniaux/ctxharness/main/.claude/skills/token-audit/SKILL.md
Clone the repo
git clone --depth 1 https://github.com/FlorianBruniaux/ctxharness

Made for: Claude Code.

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/ctxharness/token-audit.svg)](https://agentmods.dev/skills/florianbruniaux/ctxharness/token-audit)
Your own site
<a href="https://agentmods.dev/skills/florianbruniaux/ctxharness/token-audit"><img src="https://agentmods.dev/badge/skills/florianbruniaux/ctxharness/token-audit.svg" alt="Measured on agentmods" height="20"></a>
Per session 39 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,248 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. Third-party audits
  • NVIDIA SkillSpector warn 7 Sept 2026
SkillSpector: 3 findings, up to high

These are SkillSpector’s own severities. On a checked sample its high-severity flags on skills were ~96% false positives — a documented command, a public API, a “never do X” rule — so we show them as a caution to read, not a verdict. Why →

  • high Agent Snooping · line 33
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Agent Snooping · line 41
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
  • high Agent Snooping · line 80
    Skill reads from agent configuration directories (.claude/, .codex/, .gemini/). These directories may contain API keys, personal settings, and other credentials that the skill has no legitimate need to access.
    Fix: Remove all code or instructions that access agent configuration directories (.claude/, .codex/, .gemini/). If configuration values are needed, pass them explicitly as parameters or environment variabl
How audits are shown
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.00039 $0.01248
Opus 5 $0.00019 $0.00624
Sonnet 5 $0.00008 $0.00250
Haiku 4.5 $0.00004 $0.00125

Measured 8d ago against content hash 4f12f2baf4d1, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-08, 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 8d 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.

.claude/skills/token-audit/SKILL.md · 144 lines

How it starts

The opening of the file, as written. The whole thing — 144 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.

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 Always (all files) 5–40K tokens
MEMORY.md Always 1–3K tokens
Claude Code system prompt Always ~7,500 tokens
Commands, agents, skills On invocation only 0 by default

Key insight: .claude/rules/ loads every .md file at session start. Commands and agents are lazy-loaded — zero cost until invoked.


Step 1 — Run the Measurement

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

Then calculate the full budget:

PROJECT=$(wc -c < CLAUDE.md 2>/dev/null || echo 0)
RULES=$(find .claude/rules -name "*.md" 2>/dev/null | xargs cat 2>/dev/null | wc -c || echo 0)
TOTAL=$(( PROJECT + RULES + 30000 ))

echo "Project CLAUDE.md  : ~$(( PROJECT / 4 )) tokens"
echo "Rules (auto-loaded): ~$(( RULES / 4 )) tokens"
echo "System prompt      : ~7,500 tokens"
echo "---"
echo "TOTAL fixed context: ~$(( TOTAL / 4 )) tokens"
echo "% of 200K window   : $(( TOTAL / 4 * 100 / 200000 ))%"

Step 2 — Classify Rules Files

Class Definition Action
ALWAYS Applies to most tasks (conventions, safety) Keep auto-loaded
SOMETIMES Relevant in 20–40% of sessions Keep if small (<3K chars)
RARELY Relevant in <10% of sessions Remove from auto-load
NEVER Outdated or covered elsewhere Delete or archive

Read the full file on GitHub · 144 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. 8d ago First seen · 144 lines · 39 tokens per session scan A 4f12f2baf4d1

Subscribe to this mod's changes

token-audit is a skill published in the GitHub repository FlorianBruniaux/ctxharness (21 stars, last pushed 6d ago), licensed MIT. It adds 39 tokens to every session and 1,248 once invoked, about $0.0002 per session on Opus 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-08-30.