Now liveThe Skillselion MCP - thousands of ranked skills, loaded into your agent mid-task. No install.Get it →
sundial-org avatar

Clawdbot Cost Tracker

  • 37 installs
  • 638 repo stars
  • Updated March 7, 2026
  • sundial-org/awesome-openclaw-skills

Helps with ai & agent building tasks during AI-assisted development.

About

clawdbot-cost-tracker is a Claude Code skill for ai & agent building. It helps solo builders move faster with AI-assisted coding.

  • clawdbot-cost-tracker
  • AI & Agent Building
  • AI-coding skill

Clawdbot Cost Tracker by the numbers

  • 37 all-time installs (skills.sh)
  • Ranked #8,545 of 16,546 AI & Agent Building skills by installs in the Skillselion catalog
  • Data as of Aug 5, 2026 (Skillselion catalog sync)
npx skills add https://github.com/sundial-org/awesome-openclaw-skills --skill clawdbot-cost-tracker

Add your badge

Show developers this skill is listed on Skillselion. Paste this into your README.

Listed on Skillselion
Installs37
repo stars638
Last updatedMarch 7, 2026
Repositorysundial-org/awesome-openclaw-skills

What it does

Helps with ai & agent building tasks during AI-assisted development.

Files

SKILL.mdMarkdownGitHub ↗

Clawdbot Cost Tracker

Track token usage and estimate API costs across all Clawdbot sessions.

Quick Start

Get Current Usage

# Use sessions_list to get token data
sessions_list --limit 20 --messageLimit 0

Extract totalTokens and model from each session.

Calculate Cost

Model pricing (USD per million tokens):

ModelInputOutputAvg Ratio
claude-opus-4-5$15$7530/70
claude-sonnet-4$3$1530/70
codex-mini-latest$1$530/70
gpt-4o$2.5$1030/70
gpt-4o-mini$0.15$0.630/70

Cost formula (assuming 30% input, 70% output):

cost = tokens * (0.3 * input_price + 0.7 * output_price) / 1,000,000

Daily Tracking

Save Usage Snapshot

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
    }
  }
}

Calculate Daily Cost

Compare consecutive days to get daily usage:

daily_tokens = today.totalTokens - yesterday.totalTokens
daily_cost = estimate_cost(daily_tokens, model)

Scripts

scripts/snapshot-usage.js

Creates 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.js

Calculates cost for a date range.

node scripts/calculate-cost.js [date]
# Default: today
# Output: JSON with token delta and estimated cost

Integration with Daily Report

Add to HEARTBEAT.md: 1. Call sessions_list to get current tokens 2. Load previous day's snapshot from memory/usage/ 3. Calculate delta and estimate cost 4. Include in daily report format:

   💰 **Clawdbot Cost** (yesterday)
   • Used: 45.2k tokens
   • Estimated: ~$1.23

Color Conventions (Chinese Style)

For financial displays in Chinese context:

  • 🔴 Red = Up/Increase
  • 🟢 Green = Down/Decrease

Related skills

This week in AI coding

Five minutes, every Monday - the tools, releases and tactics for developers.

unsubscribe anytime.