cost-ledger
できること
このスキルは、AIコーディングツールがコンピューターに既に保存している利用ログを読み、プロバイダーごとの支出、トークン数、キャッシュの利用状況を示します。複数のAIツールを使っていて、1つの画面で見たい人向けです。
使う場面
- ✓今週、AIツールにいくら支出したかを知りたいとき。
- ✓CodexとClaude Codeのコストを比べたいとき。
- ✓まだ価格が設定されていないモデルを確認したいとき。
スキルのリンク
https://github.com/ruvnet/ruflo/blob/main/plugins/ruflo-cost-tracker/skills/cost-ledger/SKILL.mdコピーしてAI(Claude、ChatGPT、Cursor)に貼り付け、指示に従うよう頼んでください。
使い方
いちばん簡単な方法:メッセージをコピーしてAIに貼り付けるだけ。AIがスキルを読んで指示に従います。
貼り付け用メッセージ
Claude Code、Codex、Cursorの場合:プロジェクトのフォルダで実行するとスキルがインストールされます。
SKILL.mdをダウンロードして、エージェントのスキル用フォルダに入れてください。
AIへの頼み方の例
“今週、すべてのプロバイダーを合わせて、AIコーディングツールにいくら支出しましたか?”
毎週5つの新しいスキル。1分で読めます。
仕組み
スキルはローカルのログを読み、日付つきの価格表でその利用量の価格を計算して、合計を表示します。価格が不明なモデルは無料扱いにせず、別の項目として一覧にします。
技術的な内容(元のSKILL.md)
作者による元のテキスト(英語)をGitHubからそのまま表示しています。
Cost Ledger
Reads the logs the agents already wrote (~/.claude/projects, $CODEX_HOME or ~/.codex) and prices them from data/prices.json (dated, editable).
Run
node ${CLAUDE_PLUGIN_ROOT}/scripts/ledger.mjs --since 7d
node ${CLAUDE_PLUGIN_ROOT}/scripts/ledger.mjs --provider codex --format json
One mission, or one project
--from and --to (ISO times) cut the window and --project <absolute path> keeps one project's rows; the console's mission page uses them for a mission's spend. An explicit --from/--to replaces the default 7-day look-back.
Read the result correctly
- USD and Codex credits are never added. GPT-6 Codex models are priced in credits; their cached-input rate is unpublished, so the figure is an upper bound.
- Estimates at list price, not bills. Subscriptions bill by window, not by token.
/usageis authoritative for the live Claude session; the Console or provider dashboard is authoritative for invoices. - Unpriced models are listed, never counted as $0. Say so, and offer to add them to
data/prices.json. - Counting rules (why numbers differ from naive sums): Claude messages are de-duplicated by
message.id + requestId; Codex uses deltas of the runningtotal_token_usage(never alsolast_token_usage), cached input is a subset of input, and forked rollouts are de-duplicated. - Claude transcript output tokens can under-count streamed output.
If the log directory is missing, say so; do not invent numbers.
よくある質問
データはどこかに送られますか?
スキルはローカルのログだけを使い、何も送信しません。費用は、請求額ではなく定価に基づく推定値です。
なぜドルとクレジットの合計は足し合わせられないのですか?
Codexのクレジットと米ドルは単位が違うため、決して足し合わせないからです。
1つのプロジェクトだけを見られますか?
はい。プロジェクトの設定で、1つのプロジェクトフォルダーに数字を限定できます。期間も設定できます。
詳細
作者による元の説明
One cost view across Claude Code, Codex and Grok on this machine — spend, tokens, cache hit ratio per provider and model, with unpriced models flagged. Use when asked "what did I spend", "how much did Codex cost", or to compare providers. Local logs only, nothing is sent.
repo: ruvnet/ruflo
人気
- GitHubのスター
- 81k
- ランキング
- #1603
- ライセンス
- MIT
- 更新日
- 2026/11/2
コメント
- …
このリポジトリの他のスキル
agent-adaptive-coordinator
81k作業量の変化に合わせて、エージェントのグループを分割し、再配分する手助けをします。作業に合った配置を選びます。
agent-agent
81k大きな目標を順番に並んだ行動計画にし、状況が変わったときに計画を立て直す方法をエージェントに教えます。
agent-agentic-payments
81kAIの買い物のために、支出の上限、期間、販売店のルール、署名付きの承認を含む支出の委任を管理する手助けをします。
agent-analyze-code-quality
81kコードの品質を確認し、コードの臭い、技術的負債、リファクタリングの案を見つける手助けをします。ファイルは変更しません。