/install ccusage-report
Claude Code Usage Report
Uses bunx ccusage to report token consumption and costs from Claude Code sessions.
IMPORTANT: The ONLY valid subcommands are daily, weekly, monthly. Do NOT use today, this_week, this_month, or any other subcommand — they will crash.
Workflow
1. Determine the subcommand
Map the user's intent to one of the three valid subcommands:
| User intent | Subcommand | Extra flags |
|---|---|---|
| "today" / "how much today" / default | daily |
--since $(date +%Y%m%d) --until $(date +%Y%m%d) |
| "this week" / "weekly" | weekly |
(none) |
| "this month" / "monthly" | monthly |
(none) |
| "last 7 days" | daily |
--since $(date -d '7 days ago' +%Y%m%d) |
| "in February" / specific month | daily |
--since 20260201 --until 20260228 |
2. Run ccusage
{ "tool": "exec", "command": "bunx ccusage daily --no-color -z Europe/Paris -o desc --since $(date +%Y%m%d) --until $(date +%Y%m%d)" }
Replace daily with weekly or monthly as needed. Add --breakdown if the user asks for per-model details.
3. Format the output
📊 Claude Code Usage — \x3Cperiod>
Date/Period : \x3Cvalue>
Models : \x3Ccomma-separated list>
Input : \x3Cn> tokens
Output : \x3Cn> tokens
Cache read : \x3Cn> tokens
Total : \x3Cn> tokens
Cost : $\x3Camount> USD
For multi-row output (e.g. last 7 days), summarize totals and list each row briefly.
4. Deliver
- Chat: Send the formatted message directly
- Telegram (cron context): Reply with ONLY the formatted message in a code block — no extra commentary
5. Error handling
- If
bunx ccusagefails → check if bun/bunx is installed, report the error - If no data for the requested period → inform the user clearly ("No usage data found for this period")
- If the output is empty → suggest checking a broader date range
Examples
| User says | Period | Flags |
|---|---|---|
| "Show my claude code usage" | daily | (none) |
| "How much did I spend this week?" | weekly | (none) |
| "Monthly report with model breakdown" | monthly | --breakdown |
| "Usage for the last 7 days" | daily | --since $(date -d '7 days ago' +%Y%m%d) |
- 确保已安装 OpenClaw(本地或 Docker 部署)
- 在对话框中输入安装命令:
/install ccusage-report - 安装完成后,直接呼叫该 Skill 的名称或使用
/ccusage-report触发 - 根据 Skill 的参数说明提供必要输入,即可获得结构化输出
Ccusage Report 是什么?
Report Claude Code token consumption and costs using ccusage. Use when the user asks about their Claude Code usage, token consumption, API costs, spending, o... 它是一个面向 Claude Code / OpenClaw 的 AI Agent Skill 插件,目前累计下载 439 次。
如何安装 Ccusage Report?
在 OpenClaw 或 Claude Code 对话框中运行命令「/install ccusage-report」即可一键安装,无需额外配置。
Ccusage Report 是免费的吗?
是的,Ccusage Report 完全免费(开源免费),可自由下载、安装和使用。
Ccusage Report 支持哪些平台?
Ccusage Report 跨平台运行,可在任意部署了 OpenClaw / Claude Code 的环境中使用(cross-platform)。
谁开发了 Ccusage Report?
由 𝑠𝑝𝑖𝑑𝑒𝑦(@spideystreet)开发并维护,当前版本 v1.0.3。