Cost optimizer
Skill scoobydont-666/shared-claude-skills/skills/cost-optimizer
10 production-tested Claude Code skills — model routing, security hardening, code quality, tax advisory, cost optimization. Install: clone to ~/.claude/skills/
npx -y skills add scoobydont-666/shared-claude-skills --skill cost-optimizerAssembled from the repository path, not quoted from the project. Check it against their README if it does not work.
One thing to look at
- 1 stars1 stars. Stars are a popularity signal and not a quality one, but at this level it is likely that nobody has read this closely except its author, and you would be relying on your own review.
What its author says it does
Copied from the file, not written here
Unified cost awareness across Swarm operations. Claude API model routing, infrastructure electricity/TOU costs, mining profitability, cloud hosting budgets.
SKILL.md
4.2 KB, as published. Nobody here has run it
Cost Optimizer
Three cost dimensions: Claude API, Infrastructure, Cloud Hosting.
1. Claude API Costs
Model Pricing (per million tokens — input/output)
| Model | Input | Output | Use For |
|---|---|---|---|
| opus | $5.00 | $25.00 | Architecture decisions, adversarial review |
| sonnet | $3.00 | $15.00 | Default — code edits, analysis |
| haiku | $1.00 | $5.00 | Status checks, file reads, git ops |
Session-Miser Routing Rules
- Start every session on
sonnet(default) - Escalate to
opusonly for: deep reasoning, security review, complex architecture - Delegate to
haikusubagents for: search, log tails, file reads, git status, simple transforms - Use effort levels:
opus:lowis cheaper than full opus for structured tasks
See: session-miser skill for full routing logic.
See: token-miser skill for subagent cost controls.
Anti-Patterns (Avoid)
- Using Opus for git commits or file reads
- Not delegating read-only work to Haiku subagents
- Running full sessions on Opus when Sonnet suffices
- Skipping effort level specification on Opus calls
Token Tracking via Analytics Tool
# Session cost summary (use your analytics tool)
analytics-tool stats
# Cost by model
analytics-tool cost
# Dashboard (local)
open http://127.0.0.1:<service-port>
# Weekly report
analytics-tool report --period week
See: budi-analytics skill for analytics implementation.
2. Infrastructure Costs
Electricity
- TOU rates apply — peak hours cost 2-3x off-peak
- Solar offset via Enphase IQ Gateway (<gateway-ip>)
- Key metric:
solar_net_watts— positive = free electricity (exporting) - When net_watts > 0: run full mining fleet, cost = $0 for that power
Mining Profitability (Hashrate Hedger)
- Inputs: XMR spot price, network difficulty, pool hashrate, electricity rate, solar_net_watts
- Decision: run full fleet / throttle / pause based on break-even threshold
- Infrastructure: pool relay host (P2Pool relay), dedicated miner host (~10.5 KH/s), GPU-capable hosts (GPU-accelerated mining)
- Never run mining on relay nodes — they are NOT miners
Service Power Draw (approximate)
| System | Draw | Notes |
|---|---|---|
| GPU host (idle) | ~150W | Dual GPU cards |
| GPU host (mining) | ~400W+ | GPU-accelerated RandomX |
| Relay host | ~35W | CPU-only, no discrete GPU |
| Mining host | ~90W | High-performance CPU mining |
See: solar-energy skill for TOU and battery pre-positioning.
See: crypto-monero-wizard skill for mining profitability formulas.
3. Cloud Hosting — When Required
Projected Year 1 costs (when deployed):
- AWS/Azure app hosting: $40-80/mo
- Ollama inference stays self-hosted on GPU infrastructure (no cloud cost)
- PostgreSQL: RDS
$15/mo or self-hosted on GPU infrastructure ($0 marginal) - CDN/storage: minimal (<$5/mo at launch volume)
Strategy: maximize self-hosted workloads on local infrastructure before adding cloud spend.
Weekly Cost Review Checklist
session-snitch stats— check session token spend vs prior week- Grafana dashboard — GPU power draw trend
- Check solar production vs consumption ratio
- Review any cloud services added since last review
- Confirm no Opus usage for mechanical tasks (check budi by model)
Related Skills
session-miser— model routing decisionstoken-miser— subagent cost enforcementbudi-analytics— token spend dashboards and CLIsolar-energy— electricity offset via solarcrypto-monero-wizard— mining cost/profitability