ClawCost
Run this command:
CODEBLOCK0
Output
JSON with:
- -
balance: {initial, spent, remaining} or null - INLINECODE1 : cost, budget, pct
- INLINECODE2 : total week cost
- INLINECODE3 : all-time cost, tokens
- INLINECODE4 : breakdown all-time
- INLINECODE5 : breakdown for today only
- INLINECODE6 : 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:
CODEBLOCK2
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
技能名称: clawcost
详细描述:
ClawCost
运行此命令:
bash
python3 {baseDir}/scripts/clawcost.py --budget 10
输出
JSON格式,包含:
- - balance: {initial, spent, remaining} 或 null
- today: 当日费用、预算、百分比
- week: 本周总费用
- total: 历史总费用、token数
- models: 历史模型细分
- models_today: 仅当日模型细分
- daily: 每日费用(最近7天)
设置余额
用户设置初始余额(充值后):
bash
python3 {baseDir}/scripts/clawcost.py --set-balance 50.00
剩余金额自动计算:初始余额 - 总支出
展示方式
语气: 友好,像一位贴心的助手在核对开支。适度使用表情符号。
格式: 使用树形结构(├ └)呈现清晰输出:
💰 clawleaks
├ 余额 $42.98 / 剩余 $50
├ 今日 $1.36 / $10 (14%) ✅
├ 本周 $7.02
└ 总计 $7.02 (15.5M tok)
📈 Sonnet $3.99 (57%) • Haiku $2.06 (29%) • Opus $0.97 (14%)
规则:
- - 跳过费用为$0的模型
- 添加简短见解(Opus仅占14%,省钱效果不错 👍)
警报(重要):
- - 如果 today.pct > 80%:以 ⚠️ 警告:每日预算已使用{pct}%! 开头
- 如果 today.pct > 100%:以 🚨 超出预算!已花费${cost} 开头
- 如果 balance.remaining < 5:警告 💸 余额不足:仅剩${remaining}
- 如果 balance 为 null:建议 使用 --set-balance 设置初始余额
- 如果预算正常:以 ✅ 结尾
上下文相关:
- - 快速提问 → 简短回答
- 需要详情 → 完整细分 + 每日数据
- 超出预算 → 始终先显示警告,建议切换至Haiku