Skip to content

docs: name the prior art on token measurement, and state the estimator's real error - #119

Open
singhharsh1708 wants to merge 1 commit into
mainfrom
fix/measurement-claim-vs-prior-art
Open

docs: name the prior art on token measurement, and state the estimator's real error#119
singhharsh1708 wants to merge 1 commit into
mainfrom
fix/measurement-claim-vs-prior-art

Conversation

@singhharsh1708

Copy link
Copy Markdown
Owner

Two corrections to the claim this project is best known for. Docs only — no behaviour change, no version bump (the entry can ride the next release; merge after #118 to avoid a changelog collision).

1. "I have not found another tool that surfaces that number" is no longer true

skills-check (npx skills-check budget, open source) counts tokens per skill using a real cl100k_base tokenizer, gives a per-section breakdown, detects redundancy between skills via 4-gram Jaccard similarity, estimates cost across Haiku/Sonnet/Opus pricing, snapshots changes over time, and exits 1 over a configurable ceiling.

Leaving that sentence up is exactly the credibility problem the 0.11.0 pass existed to fix, on the one number this repo is known for. Someone who has used skills-check reads it and stops trusting the rest of the page.

What survives, and is now what the README says. skills-check measures the file. Kitbash measures the pair: the same skill has a different standing cost on every target because each one loads it differently, and that number falls out of a compile step that already encodes each target's loading mode. "~40 on a lazy target, ~560 on an eager one" is not a property of the skill — it is a property of the skill and the agent. That is the half nothing else does, and it is narrower and more defensible than the claim it replaces.

Worth noting what skills-check does not do: it does not distinguish standing from activation cost, and it does no security or lint checking.

2. The estimator's error is now stated, measured

The benchmark said absolute counts "will differ by a few percent against a model-specific tokenizer". I measured it rather than leaving it vague. Against o200k_base on this repo's corpus, length / 4 runs 2-11% high:

length / 4 o200k_base
prereview stub 40 35
prereview body 567 515
ratio 14.2x 14.7x

Two things follow, both now in the doc: the bias is in the safe direction for budget enforcement (a skill fails its budget slightly early, never late), and it largely cancels in the ratio — the advertised 14x is 14.7x under a real tokenizer, so the headline understates rather than overstates.

That is also the answer to the obvious attack on the pitch ("your token numbers are made up"), which is worth having in writing given a competitor ships a real tokenizer.

Verification

Numbers produced by compiling prereview through the real pipeline and encoding the emitted output with js-tiktoken's o200k_base. The corpus figure spans SKILL.md, README.md, spec/SPEC.md, and docs/roadmap.md (+11.4%, -0.6%, +4.2%, +4.3%; +2.3% aggregate).

Suite green, site/build.mjs --check current, benchmark regenerated from its generator (the prose lives in scripts/benchmark.mjs, so the committed doc stays reproducible).

…r's error

The README claimed no other tool surfaces a skill's token cost. That is
no longer true: skills-check (npx skills-check budget) counts tokens per
skill with a real cl100k_base tokenizer, breaks them down per section,
detects redundancy between skills, and fails a build over a ceiling.
Leaving the claim up would be the same credibility problem the 0.11.0
pass existed to fix, on the one number this project is known for.

Corrected to what is still specific here: the per-target half. The same
skill has a different standing cost on every agent because each loads it
differently, and that falls out of a compile step that already knows each
target's loading mode — skills-check measures the file, not the pair.

Also states the estimator's real error rather than "a few percent".
Measured against o200k_base: length/4 runs 2-11% high on this corpus
(prereview 567 vs 515, stub 40 vs 35), biased toward failing budgets
early, and the 14x ratio is 14.7x under a real tokenizer.
@vercel

vercel Bot commented Aug 22, 2026

Copy link
Copy Markdown

The latest updates on your projects. Learn more about Vercel for GitHub.

Project Deployment Actions Updated (UTC)
kitbash Ready Ready Preview Aug 22, 2026 6:27pm

@github-actions github-actions Bot added documentation Docs, spec, RFCs, README, site benchmark Benchmark script or measured numbers labels Aug 22, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

benchmark Benchmark script or measured numbers documentation Docs, spec, RFCs, README, site

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant