optimize-prompt-token-efficiency
Iteratively optimizes prompts for token efficiency by maximizing information density - reduces verbosity, removes redundancy, tightens phrasing while preserving semantic content. Use when asked to compress, shorten, reduce tokens, tighten, maximize density, increase information density, or make a prompt more concise.
npx skills add majiayu000/claude-skill-registry --skill optimize-prompt-token-efficiency --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.
# Optimize Prompt Token Efficiency Iteratively optimize prompt token efficiency by maximizing information density through verification loops. Primary goal: reduce token consumption while preserving all semantic content for AI-consumed prompts (CLAUDE.md, skills, agent prompts, specs). ## Overview This skill transforms verbose prompts into token-efficient versions through: 1. **Verification First** - `prompt-token-efficiency-verifier` checks for inefficiencies before any changes 2. **Optimization** - Apply targeted compression based on verifier feedback 3. **Re-verification** - Verify compression is lossless, iterate if issues remain (max 5 iterations) 4. **Output** - Atomic replacement only after verification passes **Loop**: Read → Verify → (Exit if efficient) → Optimize based on feedback → Re-verify → (Iterate if issues) → Output **Key principle**: Don't try to optimize in one pass. The verifier drives all changes - if it finds no inefficiencies, the prompt is already token-efficient. ## Workflow ### Phase 0: Create Todo List (TodoWrite immediately) Create todos tracking workflow phases. List reflects areas of work, not fixed steps. **Starter todos**: ``` - [ ] Input validation -
- Overview
- Workflow
- Phase 0: Create Todo List (TodoWrite immediately)
- Phase 1: Input Validation
- Phase 2: Initial Verification
- Phase 3: Optimization Loop (Verifier-Driven)
- Compression Techniques
- Phase 4: Output
- Key Principles
- Edge Cases
- Example Usage
- Example Output
Replace original atomically
mv {working_path} {original_path}
Optimize a verbose CLAUDE.md
Optimize a skill file
Optimize an agent promptWhat does the optimize-prompt-token-efficiency skill do?
Iteratively optimizes prompts for token efficiency by maximizing information density - reduces verbosity, removes redundancy, tightens phrasing while preserving semantic content. Use when asked to compress, shorten, reduce tokens, tighten, maximize density, increase information density, or make a prompt more concise.
How do I install it?
Run `npx skills add majiayu000/claude-skill-registry --skill optimize-prompt-token-efficiency --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.
