ccusage
БесплатноЗапускает вложенные скриптыНе проверенRun ccusage/ccusage to analyze local coding-agent JSONL session logs and generate daily, weekly, monthly, per-session, and 5-hour billing block token and cost…
от akillness★ 63 звезды на GitHubОб этом скилле
ccusage (ccusage/ccusage)
Source-pinned operator guide for ccusage/ccusage (ccusage v20.1.2, MIT), a local-first CLI and monorepo suite (apps/ccusage, apps/codex, apps/opencode, apps/pi, apps/amp, apps/mcp) for analyzing token consumption and estimated USD cost from local session logs.
When to use this skill
- Running
daily,weekly,monthly,session,blocks, or betastatuslineusage reports vianpx ccusage@latestorbunx ccusage. - Aggregating multi-agent usage across
--sources claude,codex,opencode,amp,droid,pi,copilot,gemini,antigravityor per-project--instances. - Exporting machine-readable
--jsonmetrics, per-model--breakdowntables, or--since/--until YYYYMMDDdate windows. - Monitoring live 5-hour billing windows (
ccusage blocks --live) or integrating@ccusage/mcp(apps/mcp). - Routing out: use
jarrodwatts-hudfor live HUD statuslines inside Claude Code,codeburnfor dedicated interactive TUI budgeting, andcc-switchfor API provider switching.
Instructions
Run offline preflight first to confirm
node,npx,bunx, or installedccusage:python3 scripts/preflight.py --jsonChoose the appropriate subcommand and source filter:
- Daily / weekly / monthly summaries:
npx ccusage@latest daily --breakdown npx ccusage@latest monthly --json - Per-session & project breakdown:
npx ccusage@latest session --instances - 5-hour billing window monitor:
npx ccusage@latest blocks --active(or--livefor real-time refresh) - Multi-agent unified view (
v20+):npx ccusage@latest daily --sources claude,codex,opencode
- Daily / weekly / monthly summaries:
Respect offline, pricing-estimate, and privacy boundaries:
- Use
--offlinein restricted/airgapped environments or CI pipelines soccusagerelies on cached LiteLLM pricing tables instead of fetching prices over the network. - Treat calculated USD costs as estimates derived from local JSONL token counts and cached model pricing; verify final billing against provider invoices.
- Pass
--jsonwhen scripting downstream reports, and redact workspace/project names before postingsessionor--instancesexports publicly.
- Use
Check dedicated sibling apps or MCP server when needed:
- Sibling CLIs in
ccusage/ccusage:@ccusage/codex,@ccusage/opencode,@ccusage/pi,@ccusage/amp, and@ccusage/mcp(apps/mcp). - Confirm before installing global packages or registering
@ccusage/mcpinto shared host configs.
- Sibling CLIs in
Examples
- Airgapped monthly multi-agent cost export:
npx ccusage@latest monthly --offline --json --breakdown --sources claude,codex,opencode - Track active 5-hour block burn rate:
npx ccusage@latest blocks --live --token-limit max - Date-filtered project audit:
npx ccusage@latest daily --since 20261101 --until 20261126 --instances
Best practices
- Prefer
--offlinewhen deterministic speed or zero outbound pricing fetches matter. - Use
--jsoninstead of scraping ANSI Unicode tables in scripts or dashboards. - Pair
ccusage(retrospective/block spend analytics) withjarrodwatts-hud(live in-session context & git HUD) rather than treating them as duplicates.
References
- Pinned upstream subcommands, flags, and monorepo apps: references/upstream.md
- Pinned source provenance and file digests: references/source.json
- Offline manifest preflight helper: scripts/preflight.py
- Eval suite: evals/evals.json
Установить ccusage в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadGlobGrepBashВложенные файлы
FAQ
Что делает скилл ccusage?
Run ccusage/ccusage to analyze local coding-agent JSONL session logs and generate daily, weekly, monthly, per-session, and 5-hour billing block token and cost reports across Claude Code, Codex, OpenCode, Amp, Pi, Copilot, Gemini, and Antigravity. Use when running npx ccusage@latest daily/monthly/blocks/statusline, exporting --json cost breakdowns, or checking --live 5-hour billing windows with --offline pricing cache. Do not use for live in-session HUD rendering (route to jarrodwatts-hud) or provider switching (route to cc-switch). Triggers on: ccusage, token usage report, billing blocks, ccusage daily, ccusage --json.
Как установить скилл ccusage?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл ccusage запускает скрипты?
Да, скилл несёт исполняемые скрипты. Проверь исходник перед установкой.
Похожие скиллы
docx
Use this skill whenever the user wants to create, read, edit, or manipulate Word documents (.docx files) or Word templates (.dotx files). Triggers include…
от AnthropicUse this skill whenever the user wants to do anything with PDF files. This includes reading or extracting text/tables from PDFs, combining or merging multiple…
от Anthropicxlsx
Use this skill any time a spreadsheet file is the primary input or output. This means any task where the user wants to: open, read, edit, or fix an existing…
от Anthropicpptx
Use this skill any time a .pptx or .potx file is involved in any way — as input, output, or both. This includes: creating slide decks, pitch decks, or…
от Anthropic