agentleFS
weininghuiweininghui/skills/clawcost/SKILL.md

clawcost

Skill1 starsChanged 12 days agoMITView on GitHub

Track OpenClaw agent costs. Check daily/weekly spending and model breakdown.

The file

We split this skill into the rules it gives an agent

7 rules. About 0 are common, 3 are distinctive, and 4 are very specific to this project.

  • ≈0

    Common · estimate

    Many files like this have a rule of this kind.

  • ≈3

    Distinctive · estimate

    This author's own choices. Worth a look.

  • 4

    Very specific

    Tied to their project's names, files or tools. Probably skip.

  • Common
  • Distinctive
  • Very specific
  1. Distinctive:

    Format: Use tree-style (├ └) for clean output:

    line 36
  2. Distinctive:

    Add brief insight ("Opus only 14%, nice savings 👍")

    line 49
  3. Very specific:

    If today.pct > 80%: Start with ⚠️ "Warning: Daily budget {pct}% used!"

    line 52
  4. Very specific:

    If today.pct > 100%: Start with 🚨 "OVER BUDGET!

    line 53
  5. Very specific:

    If balance.remaining < 5: Warn "💸 Low balance: ${remaining} left"

    line 54
  6. Very specific:

    If balance is null: Suggest "Set initial balance with --set-balance"

    line 55
  7. Distinctive:

    If budget is fine: End with ✅

    line 56

≈ “Common” is an estimate: at least 1 in 5 of the 350,495 skill files we read have a rule of the same kind, not the same words. “Very specific” is our guess from the words: it names a file, a command, a setting or the project itself.

Keep what fits and drop the rest. Your version, ready for your agents.
Files
SKILL.md

运行依赖:需要本机已安装命令 python3;缺失时先安装 / 配置,再执行正文步骤。

ClawCost

Run this command:

python3 {baseDir}/scripts/clawcost.py --budget 10

Output

JSON with:

  • balance: {initial, spent, remaining} or null
  • today: cost, budget, pct
  • week: total week cost
  • total: all-time cost, tokens
  • models: breakdown all-time
  • models_today: breakdown for today only
  • daily: cost per day (last 7 days)

Set Balance

User sets INITIAL balance (when they top up):

python3 {baseDir}/scripts/clawcost.py --set-balance 50.00

Remaining auto-calculates: initial - total_spent

How to Present

Tone: Friendly, like a helpful assistant checking expenses. Use emojis sparingly.

Format: Use tree-style (├ └) for clean output:

💰 clawleaks
├ Balance $42.98 / $50 remaining
├ Today   $1.36 / $10 (14%) ✅
├ Week    $7.02
└ Total   $7.02 (15.5M tok)

📈 Sonnet $3.99 (57%) • Haiku $2.06 (29%) • Opus $0.97 (14%)

Rules:

  • Skip $0 models
  • Add brief insight ("Opus only 14%, nice savings 👍")

Alerts (IMPORTANT):

  • If today.pct > 80%: Start with ⚠️ "Warning: Daily budget {pct}% used!"
  • If today.pct > 100%: Start with 🚨 "OVER BUDGET! ${cost} spent"
  • If balance.remaining < 5: Warn "💸 Low balance: ${remaining} left"
  • If balance is null: Suggest "Set initial balance with --set-balance"
  • If budget is fine: End with ✅

Contextual:

  • Quick question → short answer
  • Wants detail → full breakdown + daily
  • Over budget → always show warning first, suggest switching to Haiku

Download now (ZIP)

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
What did you use it for? e.g. Reviewing pull requests in a Rails app

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.