token-optimizer
Reduce token count in prompts, docs, and prose. Covers prompt compression (40-60% savings), doc formatting, TOON data serialization, and Strunk's prose clarity rules. Use when compressing prompts, optimizing docs for LLM context, or writing clear technical prose.
npx skills add majiayu000/claude-skill-registry --skill token-optimizer --agent claude-code
Same command for any agent — swap --agent for codex, cursor, copilot.
Weekly change comes from our own snapshots, not the repository page — it measures attention, not adoption.
# Token Optimizer Reduce tokens in prompts, docs, and prose while preserving meaning. ## When to Use - Prompt >1500 tokens or contains redundant phrasing - Docs/markdown need compression for LLM context - Writing prose for humans (docs, commits, PRs, error messages) - Converting JSON/YAML/XML data for LLM input (TOON) ## Quick Routing | Input Type | Go To | |-----------|-------| | User prompt / chat message | Section 1: Prompt Compression | | Docs / markdown / README | Section 2: Doc Formatting | | Commits / PRs / error messages | Section 3: Prose Clarity | | JSON / YAML / XML data | Section 4: TOON Format | ## Compression Levels | Level | Reduction | Use When | |-------|-----------|----------| | Light | 20-30% | Keep readability, human-facing prose | | Medium | 40-50% | Default for LLM context | | Heavy | 60-70% | Max compression, symbols over words | --- ## 1. Prompt Compression ### Process 1. Identify core intent 2. Extract essential context only 3. Remove filler phrases 4. Apply abbreviations & symbols 5. Output compressed version w/ token savings % ### Remove Phrases | Remove | Transform To | |--------|--------------| | "Please help me with" | (delete) | | "I need you to" | (d
- When to Use
- Quick Routing
- Compression Levels
- 1. Prompt Compression
- Process
- Remove Phrases
- Transform Patterns
- Example
- 2. Doc Formatting
- Remove Filler Words
- Compress Lists
- Structured Data Over Prose
- Heading Compression
- Table Compression
Compress text python scripts/compress.py input.md > compressed.md python scripts/compress.py input.md --stats python scripts/compress.py --level 2 < input.md Count tokens python scripts/count_tokens.py document.md Compress prompt python scripts/compress_prompt.py "your prompt text" python scripts/compress_prompt.py --file prompt.txt --level heavy
What does the token-optimizer skill do?
Reduce token count in prompts, docs, and prose. Covers prompt compression (40-60% savings), doc formatting, TOON data serialization, and Strunk's prose clarity rules. Use when compressing prompts, optimizing docs for LLM context, or writing clear technical prose.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill token-optimizer --agent claude-code` — it drops the skill into your project so the agent can pick it up. Swap the --agent value for codex, cursor or copilot if you use one of those.
Where does this skill come from?
From majiayu000/claude-skill-registry, a repository with 534 stars. We read it straight from the repository tree rather than a submitted listing, so what you see here is what is actually published.
Is a popular skill a good skill?
Not necessarily. Stars measure attention, not adoption — a repository can trend for a week and be abandoned. That is why we show the weekly change from our own snapshots next to the total, instead of a single flattering number.
