返回顶部
c

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, or wants a daily/weekly/monthly usage summary.

作者: admin | 来源: ClawHub
源自
ClawHub
版本
V 1.0.3
安全检测
已通过
369
下载量
0
收藏
概述
安装方式
版本历史

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 ```json { "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 — <period> Date/Period : <value> Models : <comma-separated list> Input : <n> tokens Output : <n> tokens Cache read : <n> tokens Total : <n> tokens Cost : $<amount> 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 ccusage` fails → 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)` |

标签

skill ai

通过对话安装

该技能支持在以下平台通过对话安装:

OpenClaw WorkBuddy QClaw Kimi Claude

方式一:安装 SkillHub 和技能

帮我安装 SkillHub 和 ccusage-report-1776233905 技能

方式二:设置 SkillHub 为优先技能安装源

设置 SkillHub 为我的优先技能安装源,然后帮我安装 ccusage-report-1776233905 技能

通过命令行安装

skillhub install ccusage-report-1776233905

下载 Zip 包

⬇ 下载 ccusage-report v1.0.3

文件大小: 2.49 KB | 发布时间: 2026-4-16 00:01

v1.0.3 最新 2026-4-16 00:01
Declare `bunx` in `metadata.openclaw.requires.bins` and normalize install slug.

Archiver·手机版·闲社网·闲社论坛·羊毛社区· 多链控股集团有限公司 · 苏ICP备2025199260号-1

Powered by Discuz! X5.0   © 2024-2025 闲社网·线报更新论坛·羊毛分享社区·http://xianshe.com

p2p_official_large
返回顶部