bokuwalily/claude-code-skills/ccusage-cli-cost-tracking

Claude Code and agent skill by bokuwalily/claude-code-skills

Trust tier 2
  • community
LLM review pending
Source check pending

Checking that the SKILL.md file is still in the repository.

非公式 ccusage CLI で Claude MAX クォータ消費を daily/weekly/blocks で集計・statusline 連携する設計。発火: token 5h block の残量確認 / 週次の出力 token 集計 / cost-guard hook 設計時 / Opus burn rate 警告

Install

npx vskill@latest install bokuwalily/claude-code-skills/ccusage-cli-cost-tracking

SKILL.md

The same SKILL.md was published earlier as bokuwalily/claude-code-skills/ccusage-cli-cost-tracking.

Procedure

  1. インストール: npm install -g ccusage (Node 20+)
  2. 基本コマンド:
  • ccusage daily — 当日の input/output/cost
  • ccusage weekly --json — 週次 JSON
  • ccusage blocks --active --json — 現在の 5h block 状態
  1. statusline 連携 (~/.claude/scripts/statusline.sh):
  • BLOCK_JSON=$(ccusage blocks --active --json)
  • tokenCounts.outputTokens / projection.remainingMinutes / costUSD を抽出
  1. キャッシュ戦略: blocks 30s / weekly 5min で statusline 高速化
  2. cost-guard hook 連携: UserPromptSubmit で閾値超え警告 (500k/800k tokens / $80/hr burn)

Pitfalls

  • ccusage は非公式 → MAX plan の cost は API 換算値で実費ではない
  • session_id × transcript の重複加算で stop_cost_log と乖離 → ccusage の per-block 値を優先
  • node version 不一致で動かない → command -v ccusage で nvm fallback
  • weekly 集計は ISO week (月曜起点) なので、Anthropic billing と日付差あり
  • block 切り替わり時に projection.remainingMinutes が NaN → null check 必須

Verification

  • ccusage blocks --active --json | jq '.blocks[0].tokenCounts' で生値確認
  • statusline で 5h:Nk(cost) 表示成功
  • cost-guard hook が 800k 超で WARN を stderr に出すこと

See Also

  • — transcript JSONL直集計によるセッション後コスト集計(ccusageが使えない環境のフォールバック/事後精算はこちら)

Security

  • Security scanPassed, 100 of 100Pattern checks on the skill's files.
  • Model reviewNot runA model review is scheduled for the next rescan.

Quality evaluation

  • Task evaluationNot runNo evaluation yet. Run one in Skill Studio.

Source

Popularity

7-day trend score
0

Not refreshed yet.

Works with

Any agent vskill installs to: 56 targets in all. These 39 have a page on this site.

  • Claude Code
  • Cursor
  • GitHub Copilot
  • Windsurf
  • Codex
  • Gemini CLI
  • Cline
  • Amp
  • Roo Code
  • Goose
  • Continue
  • Kilo Code
  • Junie
  • Trae
  • OpenHands
  • Qwen Code
  • AI Agent
  • Tabnine Chat
  • Sourcegraph Cody
  • Amazon Q
  • Firebase Genkit
  • Sweep
  • Devin
  • Phind
  • Mentat
  • Claude Desktop
  • Aider
  • GPT Pilot
  • Plandex
  • bolt.new
  • v0
  • Replit Agent
  • Anse
  • TypingMind
  • BetterChatGPT
  • LibreChat
  • Warp AI
  • Pieces
  • Fig AI
Embed badge
vskill VERIFIED badge
[![vskill VERIFIED](https://verified-skill.com/api/v1/skills/bokuwalily/claude-code-skills/ccusage-cli-cost-tracking/badge)](https://verified-skill.com/skills/bokuwalily/claude-code-skills/ccusage-cli-cost-tracking)

Something wrong with this skill or its page? Tell us.