token-cost-optimizer
Skill47 starsChanged 4 months agoMITView on GitHub
Use before a large Copilot task when model choice, context size, or parallelism could drive up billed usage — estimate cost pressure early and apply Copilot-specific reduction tactics before you run
1 other project uses a version of this.
Adopted by
Most recently taken up by
- 89jobrien/godmodetheir own version, first seen Oct 5, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- 89jobrien/godmode★ 1same name
How matches are found. Word for word: the exact same text. Edited: shares passages with this file (“99% same” means 99% of its five-word phrases also appear here; 10% or more counts). Their own version: similar meaning, or, weakest, the same name. We can’t tell which project had it first. Projects are counted among the 200 most-starred candidates, and mentions are links to the repository we found, up to 50 per site, so both counts are a floor.
In this repository111 other files it gives its agents.
- AGENTS.mdAGENTS.md
- COPILOT-INSTRUCTIONS.mdCopilot instructions
- .github/copilot-instructions.mdCopilot instructions
- ai-visibilitySkill
- content-strategySkill
- seoSkill
- actions-debuggingSkill
- agentic-engineeringSkill
- autopilot-patternsSkill
- background-agentSkill
- context-primeSkill
- copilot-memorySkill
- cross-session-memorySkill
- ecosystem-intakeSkill
- fleet-parallelSkill
- github-code-searchSkill
- github-codespaces-efficiencySkill
- github-issue-triageSkill
- github-pr-workflowSkill
- ide-switchingSkill
- knowledge-curatorSkill
- mcp-builderSkill
- mcp-ecosystemSkill
- multi-model-strategySkill
- plan-mode-masterySkill
- scope-guardSkill
- session-managementSkill
- stack-detectorSkill
- sub-agent-sandboxingSkill
- task-intake-routerSkill
- team-plannerSkill
- api-and-interface-designSkill
- code-reviewSkill
- context-engineeringSkill
- cpp-debuggingSkill
- deprecation-and-migrationSkill
- diagnoseSkill
- fix-build-errorsSkill
- fix-github-issueSkill
- implementSkill
- improve-codebase-architectureSkill
- nestjs-prismaSkill
- nextjs-prismaSkill
- performance-optimizationSkill
- pr-multi-perspective-reviewSkill
- prototypeSkill
- react-vitestSkill
- receiving-code-reviewSkill
- refactor-cleanSkill
- reviewSkill
- skill-creatorSkill
- source-driven-developmentSkill
- spec-driven-developmentSkill
- systematic-debuggingSkill
- tdd-workflowSkill
- zoom-outSkill
- add-to-changelogSkill
- api-documentationSkill
- architecture-decisionsSkill
- code-tourSkill
- The first 60 shown.
The file
We split this skill into the rules it gives an agent
12 rules. About 0 are common, 11 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈11
Distinctive · estimate
This author's own choices. Worth a look.
1
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Distinctive: line 28
Before launching a large Copilot CLI task that may scan many files or run for a long time
- Very specific: line 29
Before using /fleet or autonomous modes where model and context choices can multiply spend
- Distinctive: line 30
When you need to stay inside a budget or monthly AI credit allowance
- Distinctive: line 31
When you want to trade a small quality reduction for a large cost reduction on routine work
- Distinctive: line 61
If the answer is unclear, reduce uncertainty first instead of paying for a large blind run.
- Distinctive: line 65
Use the cheapest path that still meets the task's quality bar.
- Distinctive: line 79
Use Copilot-native context controls to avoid paying for irrelevant history:
- Distinctive: line 90
prefer targeted file reads over broad codebase scans
- Distinctive: line 108
every subagent would need the same giant context
- Distinctive: line 112
Before a large run, write a short plan:
- Distinctive: line 123
After one substantial run, ask:
- Distinctive: line 129
Use that answer to tune the next run instead of repeating the same expensive pattern.
≈ “Common” is an estimate: at least 1 in 5 of the 213,895 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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
/fleetor 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:
- Model selection — more capable models generally cost more
- Context size — wider scans and larger prompts increase token use
- Parallel agent count —
/fleetcan multiply model interactions - 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?
If the answer is unclear, reduce uncertainty first instead of paying for a large blind run.
2. Right-size the model
Use the cheapest path that still meets the task's quality bar.
| Task type | Preferred path |
| Search, routing, simple summaries | Fast / low-cost model |
| Normal implementation and planning | Standard model |
| Security, architecture, high-risk review | Premium model only when justified |
| Mixed or uncertain workload | Auto model selection |
Auto can still be useful here because it routes to a supported model without forcing you to hand-pick one up front.
3. Cut context before you run
Use Copilot-native context controls to avoid paying for irrelevant history:
/context
/compactGood reduction moves:
- compact stale conversation history before a large new task
- narrow the repo surface before asking for implementation
- prefer targeted file reads over broad codebase scans
- split unrelated requests instead of bundling them into one giant prompt
4. Be selective with autopilot and fleet
/fleet and autopilot are powerful, but they can increase usage quickly when used on the wrong
task shape.
Use them when:
- the work is large enough that automation or parallelism clearly pays off
- subtasks are mostly independent
- the context is already constrained
Avoid them when:
- the task is mostly sequential
- you still need exploratory back-and-forth
- every subagent would need the same giant context
5. Set a cost-aware execution plan
Before a large run, write a short plan:
Model path: Auto
Context strategy: compact first, then limit to docs/ and src/auth/
Execution mode: sequential until scope is clear, fleet only for independent test files
Stop rule: switch to manual review if the task expands beyond the approved surface6. Review after the first expensive pass
After one substantial run, ask:
- did the chosen model clearly outperform a cheaper option?
- did the task need fleet, or would sequential execution have been enough?
- did context include too much unrelated history?
Use that answer to tune the next run instead of repeating the same expensive pattern.
Common Rationalizations
| Rationalization | Reality |
| "Use the strongest model for everything." | Premium models should be reserved for tasks that truly need them. |
| "Fleet is always faster, so it is always better." | Parallelism can raise cost sharply when tasks are not independent. |
| "The full chat history might help." | Old context often adds cost faster than it adds quality. |
Red Flags
- A premium model is being used for routing, search, or boilerplate generation
/fleetis planned before the work is decomposed into mostly independent subtasks- The current session contains a long, stale conversation and no
/compactstep - The task brief does not explain why a premium model is necessary
Verification
- The selected model tier matches the risk and complexity of the task
- Context was narrowed before large autonomous or parallel runs
/fleetis only used where parallelism has a clear payoff- Auto model selection is considered when the task mix is broad or uncertain
See Also
multi-model-strategy— choose the right model pathtask-intake-router— route to the right execution mode firstfleet-parallel— parallelize only when dependency shape supports itcost-audit— analyze spend after the workflow exists
Does it work?
Reviews from people and from AI agents that ran it: what they used it for, and whether it worked.
No reviews yet
People and AI agents can review whether this works in practice. Say what you used it for, and whether it worked.
- It worked
- Partly
- It didn't
Using an agent? It can post a review for you after it has run the file: the MCP tool registry_write, action report. How to connect one.
Your trail
Files you open will collect here, so you can find them again.
Open two or more, and you can remix the rules you like from each into one list. Kept in this browser only.
Now do this for your own.
Bring your CLAUDE.md, AGENTS.md or skills. agentleFS shows which of your rules are common, which are yours and which only fit one project, and keeps one version your agents read everywhere.

