cost-optimizer
Skill1 starsChanged 5 months agoMITView on GitHub
Unified cost awareness across Swarm operations. Claude API model routing, infrastructure electricity/TOU costs, mining profitability, cloud hosting budgets.
3 other projects use a version of this.
Adopted by
Most recently taken up by
- ShawhinT/non-coding-skillstheir own version, first seen Jul 28, 2026
- mergisi/awesome-openclaw-agentstheir own version, first seen Mar 14, 2026
- RandomNest/aivideo-production-skillstheir own version, first seen Feb 20, 2026
Other versions3 projects use a version of this.
Word for word · 0
None found.
Edited · 0
None found.
Wrote their own version · 3
- mergisi/awesome-openclaw-agents★ 4ksame name
- ShawhinT/non-coding-skills★ 40same name
- RandomNest/aivideo-production-skills★ 15same 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 repository32 other files it gives its agents.
- ansible-hardeningSkill
- budi-analyticsSkill
- claude-to-cursorSkill
- code-consistencySkill
- code-qualitySkill
- config-auditorSkill
- container-sandboxSkill
- cpa-tax-specialistSkill
- database-designSkill
- differential-reviewSkill
- fleet-managerSkill
- grill-meSkill
- hydra-swarmSkill
- inbound-syncSkill
- infosec-architectSkill
- insecure-defaultsSkill
- model-evaluationSkill
- modern-pythonSkill
- ms-office-suiteSkill
- openclaw-opsSkill
- prd-to-planSkill
- project-managementSkill
- property-based-testingSkill
- session-miserSkill
- session-miserSkill
- skill-updaterSkill
- supply-chain-risk-auditorSkill
- systematic-debuggingSkill
- tddSkill
- token-miserSkill
- verification-before-completionSkill
- write-a-prdSkill
The file
We split this skill into the rules it gives an agent
6 rules. 0 are common, 4 are distinctive, and 2 are very specific to this project.
0
Common
Most of the 3 edited versions we read keep these.
4
Distinctive
This author's own choices. Worth a look.
2
Very specific
Tied to their project's names, files or tools. Probably skip.
- Common
- Distinctive
- Very specific
- Very specific: line 39
Start every session on sonnet (default)
- Very specific: line 42
Use effort levels: opus:low is cheaper than full opus for structured tasks
- Distinctive: line 49
Not delegating read-only work to Haiku subagents
- Distinctive: line 77
When net_watts > 0: run full mining fleet, cost = $0 for that power
- Distinctive: line 83
Never run mining on relay nodes — they are NOT miners
- Distinctive: line 109
Check solar production vs consumption ratio
“Common” is measured: kept by at least 6 in 10 of the 3 edited versions of this file we could read. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.
Files
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 weekSee: 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
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.

