token-hygiene
Skill1 starsChanged 3 months agoApache-2.0View on GitHub
Audit current session for token waste. Use when context feels slow, costs seem high, or before starting expensive work. Shows CLAUDE.md size, active MCP servers, skill count, and recommends cuts. Use when user says "check tokens", "audit context", "why is this expensive", or "token hygiene".
1 other project uses a version of this.
Adopted by
Most recently taken up by
- Growth4U-systems/claude-token-hygienetheir own version, first seen Mar 5, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- Growth4U-systems/claude-token-hygiene★ 9same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository2 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- token-optimizerSkill
The file
We split this skill into the rules it gives an agent
4 rules. About 0 are common, 3 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈3
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 13
Run these checks in order.
- Distinctive: line 55
Check for recent cache-breaking actions:
- Distinctive: line 60
If yes, note that cache is rebuilding and next few turns will be more expensive.
- Very specific: line 66
If the current model is the most expensive available tier, sanity-check it against the task: boilerplate/routine work should default …
≈ “Common” is an estimate: at least 1 in 5 of the 372,429 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
Token Hygiene Audit
Run these checks in order. Report findings as a table, then recommend top 3 actions.
1. CLAUDE.md Overhead
wc -l ~/.claude/CLAUDE.md 2>/dev/null
# Also check project-level
find . -maxdepth 2 -name "CLAUDE.md" -exec wc -l {} +- Target: under 200 lines global, under 50 lines project
- Flag any over target with estimated per-message token cost (~5 tokens/line)
2. Active MCP Servers
Count servers contributing tool schemas to this session. Check:
- Project
.mcp.jsonserver count - Which servers have
defer_loading: true - Estimate: ~1,300 tokens per server (21 tools), ~46,000 for GitHub MCP alone
Report: N servers active, ~X estimated schema tokens
3. Skill Inventory
ls ~/.claude/skills/ | wc -l
find ~/.claude/skills/ -name "SKILL.md" -exec wc -l {} + | sort -rn | head -10- Flag skills over 200 lines
- Flag skills missing
disable-model-invocationthat are tool-driven (not conversational) - Count enabled plugins in settings.json
4. Context Utilization
Advise user to run /context to see breakdown. Interpret the output:
- Over 50% = quality degradation starting, recommend
/compact - Over 70% = recommend
/compact [focus]with specific preservation instructions - Over 83% = auto-compaction imminent,
/compactnow or/clearif switching tasks
5. Cache Health
Check for recent cache-breaking actions:
- Was
/modelor/effortchanged this session? - Were MCP servers connected/disconnected?
- Was
/compactrun recently?
If yes, note that cache is rebuilding and next few turns will be more expensive.
6. Model Tier Check
- What model is the session currently on?
- Is
/fastmode enabled? It runs at frontier-model cost for faster output — flag if left on for routine, non-urgent work. - If the current model is the most expensive available tier, sanity-check it against the task: boilerplate/routine work should default cheaper and escalate only on demonstrated need (see token-optimizer's
references/model-selection.mdfor the full ladder).
7. Session Pattern Check
- How many turns so far? (Over 30 = recommend
/clear+ progress.md) - Any large unfiltered bash output in history? (Recommend PostToolUse hooks)
- Are there unused files loaded into context? (Recommend line-range reads)
Report Format
## Token Hygiene Report
| Check | Status | Value | Action |
|-------|--------|-------|--------|
| CLAUDE.md | OK/WARN | N lines | Trim to X |
| MCP Servers | OK/WARN | N active | Defer X |
| Skills | OK/WARN | N loaded | Override X |
| Context | OK/WARN | N% used | /compact |
| Cache | OK/WARN | warm/cold | Avoid switching |
| Model tier | OK/WARN | model (+fast?) | Downgrade for routine work |
| Session age | OK/WARN | N turns | /clear if >30 |
### Top 3 Recommendations
1. ...
2. ...
3. ...Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

