/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) |
- Make sure OpenClaw is installed (local or Docker)
- Run the install command in chat:
/install ccusage-report - After installation, invoke the skill by name or use
/ccusage-report - Provide required inputs per the skill's parameter spec and get structured output
What is 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... It is an AI Agent Skill for Claude Code / OpenClaw, with 439 downloads so far.
How do I install Ccusage Report?
Run "/install ccusage-report" in the OpenClaw or Claude Code chat to install it in one step — no extra setup required.
Is Ccusage Report free?
Yes, Ccusage Report is completely free (open-source). You can download, install and use it at no cost.
Which platforms does Ccusage Report support?
Ccusage Report is cross-platform and runs anywhere OpenClaw / Claude Code is available (cross-platform).
Who created Ccusage Report?
It is built and maintained by 𝑠𝑝𝑖𝑑𝑒𝑦 (@spideystreet); the current version is v1.0.3.