token-estimator
Skill29 starsChanged 7 months agoMITView on GitHub
Gives a consistent rough token-size estimate for a file or folder of text using fixed integer rules. Use when you need repeatable ballpark token counts for Markdown or plain text without calling a provider API.
In this repository13 other files it gives its agents.
- agent-creatorSkill
- agent-skill-creatorSkill
- art-engineSkill
- capability-architectureSkill
- copy-sanitizerSkill
- intent-replaySkill
- md-compressorSkill
- md-design-systemSkill
- opportunity-gap-finderSkill
- project-graphSkill
- skill-scanSkill
- story-architectSkill
- vector-drawingSkill
The file
We split this skill into the rules it gives an agent
1 rule. About 0 are common, 0 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈0
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
- Very specific: line 21
Run scripts/estimate_tokens.py when possible.
≈ “Common” is an estimate: at least 1 in 5 of the 350,495 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 Estimator
Disclaimer
Rough estimate only — not billing-grade. Same file on disk → same numbers every run. Real token counts depend on the model’s tokenizer; this skill uses a fixed heuristic (⌈chars ÷ 4⌉, English-oriented). Use for ballparks and comparisons, not hard limits.
What It Does
- One file — report
charsandest_tokens. - Folder — recursively count every
.md,.txt,.mdxfile; report per file plus total. - Read-only — never modify targets.
Workflow
- Confirm path (file or directory).
- Run scripts/estimate_tokens.py when possible; otherwise apply references/estimation-method.md.
- Reply with totals first, then per-file lines only if there is more than one file.
Rules
- Deterministic — fixed extensions, alphabetical order, integer formula
(chars + 3) // 4. - Recursive — walk subdirectories; skip
.git,node_modules,__pycache__,.venv, binaries. - Label — always say
est_tokensor~tokens, never imply exact provider counts.
Output (Minimal)
total: 5376 chars, ~1344 est_tokens
references/foo.md: 1112 chars, ~278 est_tokensOne path in the reply is enough unless the user asked for several.
Reference
- Formulas and file rules: references/estimation-method.md
When To Use
- Ballpark size of a doc, skill folder, or prompt file.
- Same metric applied twice should match (sanity check, before/after edits).
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.

