tokenizer-diagnostics

tokenizer-diagnostics is a skill for Claude Code, Codex from strikersam/autonomous-ai-agency. It costs 0 tokens per session (914 once invoked), scanned A, original, MIT.

A diagnostic guide for tokenizer behavior. A tokenizer splits text into the small pieces that a language model reads during training and use.

In plain words
What is it for?
Checking tokenizer consistency, token counts, vocabulary changes, whitespace handling, unknown tokens, and difficult input types.
Why use it?
It helps find silent mismatches that can make a model handle numbers, code, spaces, or non-English text incorrectly without obvious training errors.

Skill for Claude CodeCodex

Written for no agent in particular: nothing here depends on one. Also seen: installed under .agents/ (shared by several agents).

Good fit Checking tokenizer consistency, token counts, vocabulary changes, whitespace handling, unknown tokens, and difficult input types.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/strikersam/autonomous-ai-agency/tokenizer-diagnostics
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 strikersam/autonomous-ai-agency --skill tokenizer-diagnostics
Clone the repo
git clone --depth 1 https://github.com/strikersam/autonomous-ai-agency

Made for: Claude Code, Codex.

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 tokenizer-diagnostics

README.md
[![agentmods](https://agentmods.dev/badge/skills/strikersam/autonomous-ai-agency/tokenizer-diagnostics/github.svg)](https://agentmods.dev/skills/strikersam/autonomous-ai-agency/tokenizer-diagnostics)
Your own site
<a href="https://agentmods.dev/skills/strikersam/autonomous-ai-agency/tokenizer-diagnostics"><img src="https://agentmods.dev/badge/skills/strikersam/autonomous-ai-agency/tokenizer-diagnostics/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 tokenizer-diagnostics

Your own site · 80×15
<a href="https://agentmods.dev/skills/strikersam/autonomous-ai-agency/tokenizer-diagnostics"><img src="https://agentmods.dev/badge/skills/strikersam/autonomous-ai-agency/tokenizer-diagnostics.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 914 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe. Third-party audits
  • NVIDIA SkillSpector pass 7 Sept 2026
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.00000 $0.00914
Opus 5 $0.00000 $0.00457
Sonnet 5 $0.00000 $0.00183
Haiku 4.5 $0.00000 $0.00091

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

Security

Grade A, and why

tokenizer-diagnostics scanned grade A with 0 findings 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 11d 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.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.agents/skills/tokenizer-diagnostics/SKILL.md · 104 lines

How it starts

The opening of the file, as written. The whole thing — 104 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Skill: tokenizer-diagnostics

Purpose

Deep-dive diagnostics for tokenizer behavior in LLM training and inference. Tokenizer bugs are uniquely dangerous because they're silent — the model trains fine, but on subtly wrong data.

Trigger

Use when:

  • Switching tokenizers between training phases
  • Seeing unexpected token counts for known inputs
  • Model performs poorly on specific input types (numbers, code, non-English)
  • Vocabulary size was changed and you need to verify embedding alignment

Background

From LLM-from-scratch practitioners:

"We switched from a byte-level BPE to a unigram tokenizer mid-project. The model kept failing on numeric inputs. Turns out the new tokenizer split '2024' into ['20', '24'] while the old one kept it as ['2024']. Three weeks of investigation, one config line to fix."

Key lessons:

  1. Tokenizer consistency across train/eval/inference is critical — any mismatch is a silent bug
  2. Number tokenization varies wildly — test your tokenizer on numbers explicitly
  3. Whitespace handling — leading space matters in many BPE tokenizers (▁hello ≠ hello)
  4. Unknown token rate — >0.1% unk tokens in training data is a warning sign
  5. Vocabulary coverage — check domain-specific terms (code keywords, medical terms, etc.)

Checks Performed

1. Round-trip Consistency

# text -> tokens -> text should be lossless
original = "Hello, world! This is a test: 2+2=4"
tokens = tokenizer.encode(original)
decoded = tokenizer.decode(tokens)
assert original == decoded, f"Round-trip failed: {original!r} != {decoded!r}"

2. Numeric Tokenization

Test suite for numbers:
  Integer:     42, 1000, 1000000
  Float:       3.14, 0.001, 1e-10
  Negative:    -42, -3.14
  Year:        2024, 1999
  Phone:       555-1234
  
Report: tokens per number, consistency, surprising splits

3. Whitespace Handling

Test: "hello" vs " hello" vs "hello " vs "  hello"
Report: whether leading/trailing space creates different tokens

Read the full file on GitHub · 104 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. 11d ago First seen · 104 lines · 0 tokens per session scan A 3be667a29c97

Subscribe to this mod's changes

tokenizer-diagnostics is a skill published in the GitHub repository strikersam/autonomous-ai-agency (8 stars, last pushed today), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 914 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.