Token Optimization Skills for AI Agents
Token optimization is the practice of using less model context for the same job: retrieve only what is needed, compress what remains, cache what repeats, and measure what you spend. Skills in this topic tend to work on one of six things — prompt shape, context selection, compression of earlier turns, caching a stable prefix where the API allows it, routing turns to smaller models, and counting tokens so you can tell whether any of it helped. Read the ranked list as a set of candidates for a specific bottleneck, not as a stack to install end to end. Find the sub-topic that matches your problem, compare the entries under it, and pick one to try before adding another. If you cannot say which of the six you are fixing, start with measurement.
8 to start with18 top options
Start with these.
Token optimization is using less model context for the same job: retrieve only what is needed, compress, cache, and measure.
These are the closest matches for this work. Start with the first one and open it to install.
- Rank 01View Agent SkillDirect
token-efficiency
Token optimization best practices for cost-effective Claude Code usage, covering efficient file reading, command execution, output handling, model selection, and bash-over-read strategies.
2,362 · popularity - Rank 02View Agent SkillDirect
text-optimizer
Optimizes text, prompts, and documentation for LLM token efficiency using 52 research-backed rules across categories like token efficiency, structure, deduplication, and LLM comprehension.
2,132 · popularity - Rank 03View Agent SkillDirect
context-budget
Audits Claude Code context window consumption across agents, skills, MCP servers, and rules, identifying bloat and producing prioritized token-savings recommendations.
9,165 · popularity - Rank 04View Agent SkillDirect
prompt-engineer
Writes, refactors, and evaluates LLM prompts, covering prompt patterns, optimization for token efficiency, evaluation frameworks, structured outputs, system prompts, and context management.
5,250 · popularity - Rank 05View Agent SkillDirect
principle-guard-the-context-window
Principle for guarding the finite context window: route large payloads to subagents, read selectively, keep frequently used content inline, and cap scope per phase.
3,659 · popularity - Rank 06View Agent SkillDirect
smart-explore
Token-optimized structural code search using tree-sitter AST parsing, replacing full-file reads with search, outline, and unfold steps to explore codebases efficiently.
6,991 · popularity - Rank 07View Agent SkillDirect
qwenchance
Keeps long tasks on track by breaking loops, bounding reasoning, watching the context budget, and triggering a clean handoff before the context window fills.
2,323 · popularity - Rank 08View Agent SkillDirect
skill-progressive-disclosure-design
Decides how to split skill content between SKILL.md and reference files for context efficiency, covering progressive disclosure, triggering, and reference-file structure.
2,560 · popularity
Explore 10 more Agent Skills
- Rank 09View Agent SkillPossible
azure-aigateway
Officialdescription: "Configure Azure API Management as an AI Gateway for AI models, MCP tools, and agents. WHEN: semantic caching, token limit, content safety, load balancing, AI model governance, MCP rate limiting, jailbreak detection, add Azure OpenAI backend, add AI Foundry model, test AI gateway, LLM policies, configure AI backend, token metrics, AI cost control, convert API
514,751 · popularity - Rank 10View Agent SkillPossible
claude-api
Official|- Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER — read BEFORE opening the target file; don't skip because it "looks like a one-liner" — whenever: the prompt names Claude/Anthropic in any form (Claude, Anthropic, Fable, Opus, Sonnet, Haiku, `anthropic`, `@anthropic-ai`, `claude-*`, `us.anthropic.*`, `[1m]`); the user asks about an LLM (pricing/model choice/limits/caching) — never answer from memory; OR the task is LLM-shaped with provider unstated (agent/MCP/tool-definition/multi-agent/RAG/LLM-judge/computer-use; generate/summarize/extract/classify/rewrite/converse over NL; debugging refusals/cutoffs/streaming/tool-calls/tokens). SKIP only when another provider is being worked on (overrides all triggers): OpenAI/GPT/Gemini/Llama/Mistral/Cohere/Ollama named in the query; OR `grep -rE 'openai|langchain_openai|google.generativeai|genai|mistralai|cohere|ollama'` over the project hits (run this grep FIRST if no provider named — don't Read the file).
- Rank 11View Agent SkillPossible
gemini-api-dev
Skill for writing Gemini API code covering text, chat, multimodal, image/video/speech generation, streaming, function calling, structured output, and model migration in Python and TypeScript.
23,448 · popularity - Rank 12View Agent SkillPossible
saga
Runs an autonomous spec-driven development saga with an orchestrator agent delegating to worker subagents, keeping the orchestrator's context window clean via on-disk state.
19,670 · popularity - Rank 13View Agent SkillPossible
agent-memory-systems
Covers agent memory architecture including short-term context window, long-term vector stores, and cognitive architectures for organizing and retrieving memory.
1,966 · popularity - Rank 14View Agent SkillPossible
planning-with-files-es
Persistent file-based planning for multi-step agent tasks, keeping task_plan.md, findings.md, and progress.md on disk with lifecycle hooks injecting selected planning context.
6,413 · popularity - Rank 15View Agent SkillPossible
session-handoff
Creates handoff documents for AI agent session transfers, capturing state so fresh agents can continue work when the context window approaches capacity.
4,150 · popularity - Rank 16View Agent SkillPossible
gemini
Runs the Gemini CLI for code review, plan review, and large-context (>200k token) processing, with model selection and approval-mode guidance.
3,931 · popularity - Rank 17View Agent SkillDirect
caveman
NotableUltra-compressed communication mode that cuts output tokens while keeping technical accuracy. Levels: lite, full, ultra and the wenyan variants. Use for /caveman, "caveman mode", "talk like caveman", "be brief" or "less tokens".
- Rank 18View Agent SkillDirect
context-mode
NotableUse context-mode tools (ctx_execute, ctx_execute_file) instead of Bash/cat when processing large outputs. Triggers: "analyze logs", "summarize output", "process data", "parse JSON", "filter results", "extract errors", "check build output", "analyze dependencies", "process API response", "large file analysis", "page snapshot", "browser snapshot", "DOM structure", "inspect page", "accessibility tree", "Playwright snapshot", "run tests", "test output", "coverage report", "git log", "recent commits", "diff between branches", "list containers", "pod status", "disk usage", "fetch docs", "API reference", "index documentation", "call API", "check response", "query results", "find TODOs", "count lines", "codebase statistics", "security audit", "outdated packages", "dependency tree", "cloud resources", "CI/CD output". Also triggers on ANY MCP tool output that may exceed 20 lines. Subagent routing is handled automatically via PreToolUse hook.
What this topic covers
Each sub-topic groups Agent Skills for a specific situation.
- Prompt shape
- What you put in the prompt is the first budget item.
- Context selection
- Do not paste the whole repo if three files would do.
- Compression
- Shrink earlier turns so later ones still fit.
- Caching
- Pay once for the stable prefix if the API allows it.
- Routing
- Not every turn needs the largest model.
- Measurement
- If you do not count tokens, you are not optimizing them.
Frequently asked questions
- Where should a beginner start?
- Start with measurement: if you do not count tokens, you are not optimizing them. Once you can see where context is going, prompt shape and context selection are the cheapest things to change, since what you put in the prompt is the first budget item and three files often do the job of a whole repo.
- How is this list ordered?
- It is ranked by observed search demand, with direct matches to the topic placed first and a cap on how many entries any single publisher can occupy. Work down the list until you find a skill that addresses your bottleneck.
- Do I need all six sub-topics covered?
- No. Compression, caching, and routing each solve a different problem, and caching only applies if the API you use allows a stable prefix to be paid for once. Pick the sub-topic that matches what is actually overflowing your context.
- Can I combine several of these skills?
- You can, but each one changes how context is assembled, so add them one at a time and re-measure. A compression skill and a context selection skill can interact, and you will not see which one helped unless you count tokens before and after.
How to install an Agent Skill
Start with the first skill on this page. Claude Code reads a SKILL.md once it is in the skills directory:
- Claude Code — copy the SKILL.md for token-efficiency into ~/.claude/skills/token-efficiency/ for yourself, or .claude/skills/token-efficiency/ to share it with a project.
- From the registry — run npx skills add delphine-l/claude_global@token-efficiency.
- Or download token-efficiency from its source and place that SKILL.md in the directory above.
How to choose Check the source and the skill’s own instructions before you install. Official and Notable describe where a skill comes from.