← Browse all topicsGetting started

Less Token Usage: Cut AI Agent Costs

Less Token Usage covers skills that reduce the number of tokens an agent sends and receives, so each turn costs less and fits inside context limits. The skills here fall into six areas: prompt shape, context selection, compression of earlier turns, caching a stable prefix where the API supports it, routing turns to smaller models, and measurement. This is a beginner topic, so the skills assume you are still forming habits rather than tuning a large production system. Use the ranked list by reading each skill's description against your own bottleneck. If your prompts are long, start with prompt shape. If you paste whole repositories, start with context selection. If long conversations break, look at compression and caching. Pick one skill, apply it, and count tokens before and after.

8 to start with17 top options

Start with these.

Using fewer tokens is a design problem: smaller prompts, less context, compression, cache, cheaper models, and a counter.

These are the closest matches for this work. Start with the first one and open it to install.

What you put in the prompt is the first budget item.Do not paste everything if three files would do.Shrink earlier turns so later ones still fit.Pay once for a stable prefix if the API allows it.Not every turn needs the largest model. A sub-problem of this domain with no skills yet.If you do not count tokens, you are not optimizing them.

17 top options

  1. Rank 04
    Direct

    context-mode

    Notable

    Use 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.

    • Compression
    View Agent Skill
  2. Rank 05
    Direct

    cost-tracking

    Tracks and reports Claude Code token usage, spending, and budgets from a local metrics log, with breakdowns by model, session, and date. Directly covers token usage measurement.

    • Caching
    • Measurement

    Needs (stated): Node.js

    5,694 · popularity
    View Agent Skill
  3. Rank 06
    Direct

    session-report

    Generates an explorable HTML report of Claude Code session usage — tokens, cache, subagents, skills, and expensive prompts — from local transcripts, with optimization suggestions. Directly covers token usage measurement.

    3,019 · popularity
    View Agent Skill
  4. Rank 07
    Direct

    agent-pulse

    Inspects local AI-agent activity across many tools, reporting sessions, tokens, tool calls, model usage, estimated cost, budgets, and optimization suggestions. Directly covers token usage measurement.

    • Compression
    • Measurement
    47,517 · popularity
    View Agent Skill
  5. Rank 08
    Direct

    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).

    • Context selection
    • Compression
    View Agent Skill
Explore 9 more Agent Skills
  1. Rank 09
    Possible

    azure-aigateway

    Official

    description: "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

    • Measurement
    514,751 · popularity
    View Agent Skill
  2. Rank 10
    Possible

    gemini-api

    Official

    Use when the user asks about using Gemini in an enterprise environment or explicitly mentions Vertex AI, Google Cloud, or Agent Platform. Guides the usage of the Gemini API on Agent Platform with the Google Gen AI SDK. Covers SDK usage (Python, JS/TS, Go, Java, C#), capabilities like multimodal inputs, tools, media generation, caching, batch prediction, and Live API.

    • Measurement

    Needs (stated): Credentials

    View Agent Skill
  3. Rank 11
    Possible

    gemini-api-dev

    Guides writing code against the Gemini API covering models, streaming, function calling, and structured output. Touches token limits and model selection but is not focused on reducing token usage.

    • Measurement
    23,448 · popularity
    View Agent Skill
  4. Rank 12
    Possible

    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 context. Context selection can reduce token usage.

    6,413 · popularity
    View Agent Skill
  5. Rank 13
    Possible

    qianwen-usage

    Manages QianWenAI account auth and queries usage, billing, subscription, free-tier quota, and Token Plan status. Reports token usage but does not reduce it.

    • Measurement

    Needs (stated): Node.js

    4,914 · popularity
    View Agent Skill
  6. Rank 14
    Possible

    qwencloud-usage

    Manages QwenCloud account auth and queries usage, billing, subscriptions, free-tier quota, and Token Plan status. Reports token usage but does not reduce it.

    • Measurement
    1,424 · popularity
    View Agent Skill
  7. Rank 15
    Possible

    agent-platform-alert-configuration

    Official

    >- Configures best-practice alerting policies for AI agents using OpenTelemetry (OTel) metrics, generating output as Terraform (.tf) configuration files. Use when analyzing, writing, or deploying alerting policies to monitor agent latency, error rates, token usage, and quality metrics. Don't use for standard infrastructure monitoring unrelated to AI agents, or when the agent is not instrumented with OpenTelemetry (for Reliability, Cost, Safety, Security alerts). NOTE: Reliability, Cost, Safety, and Security alerts use generic OTel metrics and work across runtimes (such as Cloud Run, Vertex AI). Quality alerts rely on Vertex AI Online Monitors and are strictly bound to Vertex AI deployments.

    • Measurement

    Needs (stated): Python

    View Agent Skill
  8. Rank 16
    Possible

    loop-design-check

    Designs and reviews goal-oriented agent loops for failure modes like spinning and runaway execution, covering machine-decidable goals and runaway prevention. Runaway prevention can bound token spend.

    2,883 · popularity
    View Agent Skill
  9. Rank 17
    Possible

    vercel-cli-with-tokens

    Official

    Deploy and manage projects on Vercel using token-based authentication. Use when working with Vercel CLI using access tokens rather than interactive login — e.g. "deploy to vercel", "set up vercel", "add environment variables to vercel".

    View Agent Skill
What this topic covers

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 everything if three files would do.
Compression
Shrink earlier turns so later ones still fit.
Caching
Pay once for a 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

Frequently asked questions

How is this list ordered?
Skills are ranked by observed search demand, with direct matches to the topic placed first. The ranking also caps how many skills any single publisher can occupy, so one author cannot fill the page.
Do I need to measure tokens before using any of these skills?
Measurement is one of the sub-topics, and the orientation is blunt: if you do not count tokens, you are not optimizing them. Counting first tells you which of the other areas, such as prompt shape or context selection, is actually costing you.
Which sub-topic should a beginner start with?
Prompt shape is the first budget item, because what you put in the prompt determines the rest. Context selection is the next lever: do not paste everything if three files would do.
Can caching and routing be used together with compression?
They address different parts of the bill. Caching pays once for a stable prefix where the API allows it, routing sends turns that do not need the largest model to a smaller one, and compression shrinks earlier turns so later ones still fit.

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 caveman into ~/.claude/skills/caveman/ for yourself, or .claude/skills/caveman/ to share it with a project.
  • From the registry — run npx skills add JuliusBrussee/caveman@caveman.
  • Or download caveman 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.