token-cost-optimizer
Skill1 starsChanged 56 days agoMITView on GitHub
Use when analyzing Claude or agent token usage, ccusage reports, output-to-input token ratios, model spend, or ways to lower AI coding costs. Symptoms - the user asks "why is Claude expensive", "analyze token usage", "reduce token usage", "optimize costs", "make agents less verbose", "lower output/input ratio", or shares `ccusage` output. Produces concise technical strategies, model-routing rules, and copy-paste cost-control policies.
1 other project uses a version of this.
Adopted by
Most recently taken up by
- drvoss/everything-copilot-clitheir own version, first seen Aug 9, 2026
Other versions1 project uses a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 1
- drvoss/everything-copilot-cli★ 47same 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 repository76 other files it gives its agents.
- CLAUDE.mdCLAUDE.md
- godmode:agent-governanceSkill
- godmode:agent-improvement-loopSkill
- agents-skill-saveSkill
- baml-add-typesSkill
- godmode:brainstormSkill
- godmode:capSkill
- godmode:changelogSkill
- godmode:ci-fixSkill
- godmode:code-reviewSkill
- godmode:context-mapSkill
- godmode:cross-issueSkill
- godmode:crs-discoverSkill
- godmode:crs-hook-testingSkill
- godmode:crs-installSkill
- godmode:crs-propose-rulesSkill
- godmode:crs-validateSkill
- godmode:dead-codeSkill
- godmode:decomposeSkill
- godmode:dep-auditSkill
- godmode:dep-bumpSkill
- godmode:designSkill
- devloop-session-primerSkill
- godmode:dialecticSkill
- godmode:doc-maintainerSkill
- godmode:doc-reviewSkill
- godmode:doc-syncSkill
- godmode:doc-writerSkill
- doob-db-inspectorSkill
- doob-release-managerSkill
- godmode:doublecheckSkill
- dual-forge-pr-mergeSkill
- gh-bulk-issuesSkill
- godmode:health-scoreSkill
- godmode:ingestSkill
- godmode:introspectionSkill
- godmode:issue-triageSkill
- godmode:memory-bankingSkill
- godmode:mergeSkill
- godmode:mini-context-graphSkill
- godmode:mistake-trackerSkill
- godmode:moaSkill
- notfiles-release-workflowSkill
- godmode:observability-as-infrastructureSkill
- godmode:parallel-agentsSkill
- godmode:pattern-learnerSkill
- planning-with-cruxSkill
- godmode:pr-authorSkill
- godmode:receiving-reviewSkill
- godmode:refactoringSkill
- godmode:release-notesSkill
- release-readiness-checkSkill
- remote-upstream-triageSkill
- repo-gap-backlogSkill
- godmode:rust-conventionsSkill
- rustqualSkill
- rustqual-workspaceSkill
- rust-release-workflow-authorSkill
- godmode:self-reflectSkill
- session-wrap-commit-pushSkill
- The first 60 shown.
The file
Show its rules and text
We split this skill into the rules it gives an agent
27 rules. About 0 are common, 26 are distinctive, and 1 is very specific to this project.
≈0
Common · estimate
Many files like this have a rule of this kind.
≈26
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 10
Use this when the user wants to understand or reduce LLM/agent costs.
- Distinctive: line 12
Do not assume input tokens are the problem just because token totals are large.
- Distinctive: line 17
Prefer already-attached command output when available.
- Very specific: line 18
If more data is needed and ccusage is available, run read-only reports.
- Distinctive: line 19
Use JSON output for aggregates and rendered output for quick inspection.
- Distinctive: line 42
Use tighter response formats and review filters.
- Distinctive: line 46
Keep the response concise.
- Distinctive: line 48
Avoid broad generic advice when a measured driver is available.
- Distinctive: line 49
Do not paste full command output back to the user.
- Distinctive: line 55
Default final answers to 150 words unless detail is requested.
- Distinctive: line 57
Do not paste full files, full diffs, or full logs unless explicitly requested.
- Distinctive: line 58
Prefer file paths, symbols, and short conceptual summaries over copied code.
- Distinctive: line 59
Keep progress updates brief and save detailed findings for final conclusions.
- Distinctive: line 63
Use Haiku for triage, summarization, log clustering, issue extraction, and simple classification.
- Distinctive: line 64
Use Sonnet for normal coding, debugging, test repair, and code review.
- Distinctive: line 65
Use Opus only for ambiguous root cause analysis, architectural tradeoffs, security-sensitive review, or after cheaper models fail.
- Distinctive: line 66
If a session becomes Opus-heavy, stop and confirm the escalation is still worth the spend.
- Distinctive: line 73
Avoid repeatedly re-explaining the same root cause after it is established.
- Distinctive: line 77
Use parallel agents only for independent tasks.
- Distinctive: line 79
Avoid broad "research everything" prompts that cause duplicated summaries.
- Distinctive: line 83
Start a fresh session after unrelated tasks to avoid carrying excess context.
- Distinctive: line 84
Prefer targeted file reads/searches over pasting large context into prompts.
- Distinctive: line 85
Keep stable rules short; long always-on rules increase cache creation and can make every turn heavier.
- Distinctive: line 89
Use this as a standing cost-control rule:
- Distinctive: line 95
Use this for review tasks:
- Distinctive: line 101
Use this for debugging:
- Distinctive: line 109
When presenting analysis, use this structure:
≈ “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
When to Use
Use this when the user wants to understand or reduce LLM/agent costs. Focus on measured drivers before giving advice: model mix, output volume, cache creation, session length, subagent fan-out, and repeated verbose reporting. Do not assume input tokens are the problem just because token totals are large; generated output and expensive model choice are often the largest controllable costs.
Workflow
- Gather usage data.
- Prefer already-attached command output when available.
- If more data is needed and
ccusageis available, run read-only reports. - Use JSON output for aggregates and rendered output for quick inspection.
ccusage monthly --json --offline
ccusage weekly --json --offline
ccusage daily --breakdown --offline
ccusage session --breakdown --offline
ccusage daily --instances --breakdown --offline
ccusage blocks --offline- Identify cost drivers.
- Total cost and trend by month/week/day.
- Output/input ratio using direct input and output tokens.
- Per-model cost share, especially Opus and Sonnet.
- High-cost days, sessions, blocks, or projects.
- Cache creation versus cache reads; high cache creation can signal repeated context rebuilds.
- Multipliers from parallel agents, long reviews, broad planning, or verbose final summaries.
- Recommend controls in priority order.
- Reduce generated output first.
- Route simple work to cheaper models.
- Make Opus explicit/escalation-only.
- Use tighter response formats and review filters.
- Limit subagent fan-out and long-running sessions.
- Audit the specific sessions/projects causing spikes.
- Keep the response concise.
- Give numbers first, then actions.
- Avoid broad generic advice when a measured driver is available.
- Do not paste full command output back to the user.
Cost Controls
Output budget
- Default final answers to 150 words unless detail is requested.
- For code changes, report only
Changed,Validated, andRisks. - Do not paste full files, full diffs, or full logs unless explicitly requested.
- Prefer file paths, symbols, and short conceptual summaries over copied code.
- Keep progress updates brief and save detailed findings for final conclusions.
Model routing
- Use Haiku for triage, summarization, log clustering, issue extraction, and simple classification.
- Use Sonnet for normal coding, debugging, test repair, and code review.
- Use Opus only for ambiguous root cause analysis, architectural tradeoffs, security-sensitive review, or after cheaper models fail.
- If a session becomes Opus-heavy, stop and confirm the escalation is still worth the spend.
Review and debugging limits
- For code review, report only actionable correctness, security, data-loss, race-condition, and broken-test findings.
- Suppress compliments and low-value style nits.
- For logs, extract failing test names, file paths, line numbers, and the first causal error.
- Avoid repeatedly re-explaining the same root cause after it is established.
Subagent controls
- Use parallel agents only for independent tasks.
- Give each subagent a strict return format: answer, evidence, confidence, max five bullets.
- Avoid broad "research everything" prompts that cause duplicated summaries.
Session hygiene
- Start a fresh session after unrelated tasks to avoid carrying excess context.
- Prefer targeted file reads/searches over pasting large context into prompts.
- Keep stable rules short; long always-on rules increase cache creation and can make every turn heavier.
Copy-Paste Policy
Use this as a standing cost-control rule:
Default to concise responses. Keep final answers under 150 words unless I ask for detail. Do not paste full files, full diffs, or full logs unless requested. For implementation work, report only Changed, Validated, and Risks. Use cheaper models for triage and summarization. Treat Opus as escalation-only for hard root-cause, architecture, or security-sensitive work.Use this for review tasks:
Review only for correctness, security, data loss, race conditions, broken tests, and maintainability issues that can cause real bugs. Suppress compliments, style nits, and restatements of the diff. One concise paragraph per finding.Use this for debugging:
Extract only the failing command, failing test or operation, file paths, line numbers, and first causal error. State the likely root cause only after evidence is collected. Do not include full logs unless I ask.Report Shape
When presenting analysis, use this structure:
- Trend: cost and token direction over time.
- Drivers: model mix, output/input ratio, high-cost sessions, cache behavior.
- Actions: the smallest set of controls likely to reduce spend.
- Next audit: one or two commands to identify the next bottleneck.
Common Misreads
- High total token count may be cache reads, not direct expensive generation.
- A low input token count with high cost usually points to output volume or expensive model choice.
- Monthly cost can look lower early in a month; compare run rate, not just absolute spend.
- Broad review, planning, and subagent workflows can cost more than implementation.
- Adding more input does not fix a high output/input ratio; reduce unnecessary output instead.
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.

