Tracks token usage and estimates API costs for Clawdbot sessions across Claude, GPT, and Codex models. Useful for daily/weekly cost reporting and spending monitoring.
Ships in sundial-org-awesome-openclaw-skills-4. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Track token usage and estimate API costs across all Clawdbot sessions.
# Use sessions_list to get token data
sessions_list --limit 20 --messageLimit 0
Extract totalTokens and model from each session.
Model pricing (USD per million tokens):
| Model | Input | Output | Avg Ratio |
|---|---|---|---|
| claude-opus-4-5 | $15 | $75 | 30/70 |
| claude-sonnet-4 | $3 | $15 | 30/70 |
| codex-mini-latest | $1 | $5 | 30/70 |
| gpt-4o | $2.5 | $10 | 30/70 |
| gpt-4o-mini | $0.15 | $0.6 | 30/70 |
Cost formula (assuming 30% input, 70% output):
cost = tokens * (0.3 * input_price + 0.7 * output_price) / 1,000,000
Store daily snapshots in memory/usage/YYYY-MM-DD.json:
{
"date": "2026-01-29",
"timestamp": "2026-01-29T08:20:00+08:00",
"sessions": {
"session_key": {
"model": "claude-opus-4-5",
"totalTokens": 123456,
"channel": "discord"
}
},
"summary": {
"totalTokens": 250000,
"byModel": {
"claude-opus-4-5": 220000,
"codex-mini-latest": 30000
}
}
}
Compare consecutive days to get daily usage:
daily_tokens = today.totalTokens - yesterday.totalTokens
daily_cost = estimate_cost(daily_tokens, model)
scripts/snapshot-usage.jsCreates a usage snapshot from current session data.
node scripts/snapshot-usage.js [output-dir]
# Default output: memory/usage/YYYY-MM-DD.json
scripts/calculate-cost.jsCalculates cost for a date range.
node scripts/calculate-cost.js [date]
# Default: today
# Output: JSON with token delta and estimated cost
Add to HEARTBEAT.md:
sessions_list to get current tokensmemory/usage/💰 **Clawdbot Cost** (yesterday)
• Used: 45.2k tokens
• Estimated: ~$1.23
For financial displays in Chinese context:
What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
cost-tracking, token-usage, ai-costs, usage-monitoring, clawdbot
/sundial-org-awesome-openclaw-skills-4:clawdbot-cost-trackerfrom sundial-org-awesome-openclaw-skills-4
sundial-org-awesome-openclaw-skills-4@cascade-ai-ml-agents-misc-2 is listed by joshuarweaver/cascade-ai-ml-agents-misc-2 — review the source before installing
npx claudepluginhub joshuarweaver/cascade-ai-ml-agents-misc-2 --plugin sundial-org-awesome-openclaw-skills-4908 skills in this plugin
/1passwordSet up and use 1Password CLI (op). Use when installing the CLI, enabling desktop app integration, signing in (single or multi-account), or reading/injecting/running secrets via op./a11y-checkerScan HTML and JSX for accessibility issues with AI-powered fix suggestions/abm-outboundMulti-channel ABM automation that turns LinkedIn URLs into coordinated outbound campaigns. Scrapes profiles, enriches with Apollo (email + phone), gets mailing addresses via Skip Trace, then orchestrates email sequences, LinkedIn touches, and handwritten letters via Scribeless. The secret weapon for standing out in crowded inboxes.Other plugins' skills for the same job