Getting it into your agent
This one installs as part of its plugin. Adding the marketplace and installing the plugin brings it with everything else the plugin ships.
/plugin marketplace add ChewbaccaRoars/claude-code-cost-tracker/plugin install cost-trackerWrote this? Show the measurements
A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.
[](https://agentmods.dev/skills/chewbaccaroars/claude-code-cost-tracker/cost-optimize)<a href="https://agentmods.dev/skills/chewbaccaroars/claude-code-cost-tracker/cost-optimize"><img src="https://agentmods.dev/badge/skills/chewbaccaroars/claude-code-cost-tracker/cost-optimize.svg" alt="Measured on agentmods" height="20"></a>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.
| Model | Per session | Once invoked |
|---|---|---|
| Fable 5.1 | $0.00052 | $0.00483 |
| Opus 5 | $0.00026 | $0.00242 |
| Sonnet 5 | $0.00010 | $0.00097 |
| Haiku 4.5 | $0.00005 | $0.00048 |
Grade A, and why
cost-optimize 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 6d 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.
What it actually says
Cost Optimizer - Smart Spending Recommendations
You are a cost optimization advisor. The user wants actionable recommendations to reduce their Claude Code spending based on their actual usage patterns.
How It Works
The optimizer analyzes the user's cost log and identifies specific patterns:
- Model tier mismatches — Opus sessions that could run on Sonnet
- Cache inefficiency — short sessions that waste cache warmup costs
- Context bloat — sessions with excessive context window usage
- Project patterns — projects using expensive models for routine work
- Session name patterns — correlating task types (debug, review, docs) with costs
- Time patterns — when the most expensive sessions happen
- Subagent overhead — multi-model session cost patterns
Running the Analyzer
node "${CLAUDE_PLUGIN_ROOT}/skills/cost-optimize/scripts/recommend.js" $ARGUMENTS
Available arguments: today, week, month, all (default: all)
Instructions
- Run the recommendation script with the user's requested time range
- Present the findings directly — the output is pre-formatted markdown
- If the user asks follow-ups, read
~/.claude/cost-tracker/cost-log.jsonland analyze specific patterns they're interested in - Be specific and actionable — don't just say "use a cheaper model," explain WHEN and WHY based on their data
Key Principles
- Every recommendation must reference the user's actual data (session counts, dollar amounts)
- Savings estimates should be conservative — underpromise and overdeliver
- Recommendations should be easy to act on: specific commands, settings, or workflow changes
- Never recommend downgrading when it would hurt quality — acknowledge when Opus is worth the cost
- Consider the user's workflow holistically — a session that costs more but saves developer time is still a good trade
What ships with it
1 file beside SKILL.md in the same directory: the scripts, references and assets a skill reads on demand. Not counted in the per-session cost; read them before you install if any of them is executable.
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.
- 6d ago First seen · 48 lines · 52 tokens per session scan A 7cae91c6d3f0
cost-optimize is a skill published in the GitHub repository ChewbaccaRoars/claude-code-cost-tracker (6 stars, last pushed 2mo ago), licensed MIT. It adds 52 tokens to every session and 483 once invoked, about $0.0003 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-31.
Other skills, from other repositories
sector-rotation
行业轮动分析——申万行业景气度评分、行业动量排名、产业链传导、估值/盈利/资金流多维比较框架.
strategy-pivot-designer
Detect backtest iteration stagnation and generate structurally different strategy pivot proposals when parameter tuning reaches a local optimum.
twitter-reader
Read Twitter/X for financial research using opencli (read-only). Use this skill whenever the user wants to read their Twitter feed, search for financial tweets, view bookmarks, look up user profiles, or gather market sentiment from Twitter/X. Triggers include: "check my feed", "search Twitter for", "show my…
chenhao-limit-up
Use when evaluating A-share limit-up (涨停板) setups through Chen Hao's sentiment and momentum lens: market emotion cycles, board strength, follow-through, and short-term aggressive momentum trading.
trading-risk-gate
Unified pre-trade safety gate: Ruin check (Law #1), ergodicity audit, and win-rate dominance validation. Absorbs: ergodicity-check, law-of-ruin, win-rate-dominance.
vectorbt
High-performance vectorized backtesting with parameter optimization, portfolio simulation, and rich performance metrics.