token-cost-optimizer

A cost-control guide for large GitHub Copilot tasks. It helps choose models, limit the context sent to them, and decide when parallel agents are worth the extra usage.

In plain words
What is it for?
Planning budgets before long tasks, choosing between models, reducing context, and controlling use of autonomous or parallel Copilot modes.
Why use it?
Large scans, long autonomous runs, and parallel work can consume more metered Copilot usage than necessary. It helps trade some convenience or quality for lower cost when appropriate.

Skill for Claude CodeCodex

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.

agentmods
npx agentmods add skills/drvoss/everything-copilot-cli/token-cost-optimizer
Any agent
npx skills add drvoss/everything-copilot-cli --skill token-cost-optimizer
Clone the repo
git clone --depth 1 https://github.com/drvoss/everything-copilot-cli

Made for: Claude Code, Codex.

Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 1,316 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
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 $0.00042 $0.01316
Opus 5 $0.00021 $0.00658
Sonnet 5 $0.00008 $0.00263
Haiku 4.5 $0.00004 $0.00132

Measured 2d ago against content hash 6a4f92f4c21c, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

token-cost-optimizer 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 2d 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.

skills/copilot-exclusive/token-cost-optimizer/SKILL.md · 159 lines

How it starts

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

Token Cost Optimizer

Token Cost Optimizer is a proactive cost-control skill for GitHub Copilot. It helps you reduce metered usage before and during a task by choosing the right model path, cutting unnecessary context, and avoiding parallel work that burns credits without enough payoff.

Why This is Copilot-Exclusive

GitHub Copilot now exposes cost-sensitive control surfaces that matter directly in the CLI:

  • Model pricing for token-based usage across Copilot models
  • Premium request multipliers that vary by model and feature surface

This skill focuses on Copilot-native levers such as /model, Auto model selection, /compact, /context, autopilot, and /fleet rather than generic LLM budgeting advice.

When to Use

  • Before launching a large Copilot CLI task that may scan many files or run for a long time
  • Before using /fleet or autonomous modes where model and context choices can multiply spend
  • When you need to stay inside a budget or monthly AI credit allowance
  • When you want to trade a small quality reduction for a large cost reduction on routine work

When NOT to Use

Instead of token-cost-optimizer Use
You are auditing historical spend after the fact workflow/cost-audit
The task is tiny and the model choice is obvious do the task directly
You need to choose execution mode before cost strategy task-intake-router

Cost Drivers

The main Copilot cost drivers are:

  1. Model selection — more capable models generally cost more
  2. Context size — wider scans and larger prompts increase token use
  3. Parallel agent count/fleet can multiply model interactions
  4. Autonomous depth — long autopilot runs can continue consuming usage while you are not intervening

Workflow

1. Estimate the task shape first

Ask:

  • how many files must be read?
  • does the work need a premium model?
  • is the task truly parallelizable?
  • can the context be narrowed before starting?

Read the full file on GitHub · 159 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. 2d ago First seen · 159 lines · 42 tokens per session scan A 6a4f92f4c21c

Subscribe to this mod's changes

token-cost-optimizer is a skill published in the GitHub repository drvoss/everything-copilot-cli (45 stars, last pushed 6d ago), licensed MIT. It adds 42 tokens to every session and 1,316 once invoked, about $0.0002 per session on Opus 5. 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-30.

Related

Other skills, from other repositories

winui-session-report

Analyze the current or a recent agent session (GitHub Copilot CLI or Claude Code) and generate a diagnostic report. Use only when the user explicitly asks for session feedback, agent debugging, or a review of what happened during a build session. Do not inspect session data automatically.

microsoft/win-dev-skills · 61 tokens

rig

Minimal agent cli harness for defining harnesses in prompts as rig markdown fences.

githubnext/rig · 17 tokens

atifact

This skill should be used when the user asks to "extract agent trajectory", "convert HAR to trajectory", "get trajectory from session", "parse agent session", "convert Claude Code logs", "convert Copilot CLI logs", "extract ATIF", or needs to convert HAR files or JSONL session logs into ATIF trajectory JSON using the…

waldekmastykarz/atifact · 75 tokens

update-skill-with-log

允许 organizer 和 player 调整 skill,但每次变更都必须同步做文档记录。.

ttxttx1111/sts2-llm · 26 tokens

explain-project-design

把这个仓库解释成一个从 coordinator-heavy live loop 演进到 standalone bridge 的版本化多智能体设计。.

ttxttx1111/sts2-llm · 31 tokens

ai-ready

ANALYSIS SKILL — Analyze any repository and generate AI-ready configuration — AGENTS.md, copilot-instructions.md, skills, CI workflows, issue templates. WHEN: "make this repo ai-ready", "set up AI config", "add copilot instructions", "prepare this repo for AI contributions", "generate AGENTS.md". INVOKES: glob, grep…

johnpapa/ai-ready · 107 tokens