2.5k
GitHub Stars
3
Bundled Files
2 months ago
Catalog Refreshed
4 months ago
First Indexed
Readme & install
Copy the install command, review bundled files from the catalogue, and read any extended description pulled from the listing source.
Installation
Preview and clipboard use veilstrat where the catalogue uses aiagentskills.
npx veilstrat add skill openclaw/skills --skill clawcost- _meta.json270 B
- README.md1.9 KB
- SKILL.md1.7 KB
Overview
This skill tracks OpenClaw agent spending and provides quick daily, weekly, and all-time cost summaries. It outputs a compact JSON and a tree-style console summary showing balance, today vs budget, weekly totals, model breakdowns, and recent daily costs. Use it to monitor model-level spending and catch budget overruns early.
How this skill works
Run the clawcost script with an optional --budget or --set-balance flag. The script inspects usage logs and aggregates costs into fields: balance (initial, spent, remaining), today (cost, budget, pct), week, total (cost and tokens), models (all-time breakdown), models_today, and daily (last 7 days). It prints JSON for automation and a human-friendly tree summary with alerts when thresholds are exceeded.
When to use it
- Daily check-in to ensure agents stay within a daily budget.
- Weekly reviews to compare model-level spend and spot expensive models.
- After topping up funds — set initial balance with --set-balance.
- When you suspect a runaway agent or sudden cost spike.
- Before deploying new agents to confirm available balance.
Best practices
- Set an initial balance using --set-balance so remaining funds calculate automatically.
- Provide a sensible daily budget with --budget to enable meaningful pct alerts.
- Automate a daily cron job to capture trends and save the JSON output.
- Skip $0 models in summaries to keep output focused on actual spenders.
- When over budget, consider switching traffic to a cheaper model (e.g., Haiku).
Example use cases
- Run python3 scripts/clawcost.py --budget 10 each morning to get today's pct and model hot-spots.
- Top up funds with python3 scripts/clawcost.py --set-balance 50.00 and verify balance remaining.
- Integrate JSON output into a dashboard that triggers alerts when today.pct > 80%.
- Investigate a sudden cost increase by reviewing models_today and the last 7 daily entries.
- Archive historical outputs to compare month-over-month agent spending patterns.
FAQ
A concise tree showing balance, today vs budget, week, total, then a compact model breakdown line and a short insight. Alerts appear at the top when thresholds are hit.
What if balance is unknown?
If balance is null the skill suggests setting the initial balance with --set-balance so remaining funds can be calculated.
How are over-budget situations handled?
If today.pct > 80% a warning is shown; if > 100% an over-budget alert starts the output. The tool also recommends switching to cheaper models like Haiku.