ClaudeMods
☰
JA
● 0 人がオンライン ・閲覧 0 回
スポンサー作品を投稿
GitHub リポジトリ · 投稿者 omeraltinova

usage-footer

プロンプト下のフッターに、プロンプト キャッシュのカウントダウンと 5 時間・週次の制限ウィンドウにおける API 相当コストを表示し、モデル別のトークンとコスト内訳カードをクリックで開ける Claude Code mod。

omeraltinova@omeraltinova

omeraltinova/claude-usage-footer/tree/main/plugins/usage-footer

元の投稿の画像1
翻訳済み

この mod について

usage-footer は、プロンプト下のモデル名の横に使用状況を置く Claude Code プラグインです。フッターにはプロンプト キャッシュのカウントダウン(緑から赤への色分け)と、現在の 5 時間および週次の制限ウィンドウでのリクエスト料金を API 公開価格で表示します。ペースに応じて色が変わり、リセット前に制限へ達するペースなら赤、85–100% なら黄、それ以外は緑です。▾ をクリックするか /usage-footer を実行すると、プロンプトの上にカードが開きます。各ウィンドウには、現在のペースで制限に達する時刻または終了時点、合計コスト、キャッシュ ヒット率、モデルごとのリクエスト、入力、キャッシュ読み取り、キャッシュ書き込み、出力、ヒット率、コストの行が表示されます。

アカウント固有のウィンドウで動きます(報告されたリセット時刻の1ウィンドウ分前から開始)。コストは ~/.claude/projects にあるローカル トランスクリプトから計算し、サブエージェントを含むマシン上の全セッションを対象にします。リクエストごとに重複排除し、API 公開価格で算出します(サブスクリプション料金ではありません)。小さな Node.js スクリプトが各ターンの終わりと 5 分ごとにトランスクリプトを増分スキャンします。数十ミリ秒で終わり、モデルのリクエスト ストリーム内では何も実行しません。

要件:Claude Code v2.1.287 以降(ターミナルまたは Desktop Code タブ)と、macOS、Linux、Windows の PATH または標準インストール場所にある Node.js。

インストール: claude plugin marketplace add omeraltinova/claude-usage-footer claude plugin install usage-footer@claude-usage-footer

新しいセッションを開始するか /reload-plugins を実行します。MIT ライセンスです。

インストール

まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。

claude plugin marketplace add omeraltinova/claude-usage-footer
claude plugin install usage-footer
原文 / README

usage-footer

A Claude Code mod that puts your usage where you look anyway: beside the model name under the prompt.

usage-footer in the terminal: the footer under the prompt and the card above it

▾ ◷42 — 5h $82 — 7d $115
  • ◷42: minutes left before this session's prompt cache expires. Green while fresh, sliding through yellow to red as it runs out.
  • 5h $82: what the requests in your current 5-hour limit window would cost at API list prices.
  • 7d $115: the same for your current weekly limit window. While the session runs Fable, this slot shows Fable's own weekly window (F $…).

The 5h and 7d values are colored by pace: red if, at the pace so far, the limit fills before the window resets; yellow if it ends the window at 85–100%; green otherwise.

Click ▾ (or run /usage-footer) for a card above the prompt with, per window:

  • when the limit fills at the current pace, or where it ends the window
  • the total cost and the cache hit rate
  • one row per model: requests, input, cache read, cache write, output, hit rate, cost

How it works

  • The windows are your account's own: each starts its length (5 hours, 7 days) before the reset time Claude Code reports for that limit, not a rolling "last 5 hours".
  • Costs come from your local transcripts (~/.claude/projects, including subagents), across every session on this machine, deduplicated per request and priced at API list prices. It is not what a subscription charges.
  • A small Node.js script scans the transcripts incrementally at the end of each turn and every 5 minutes; a scan takes tens of milliseconds. Nothing runs inside the model's request stream.

Requirements

  • Claude Code v2.1.287 or later (mods), in the terminal or the Code tab of the Desktop app.
  • Node.js on the machine. The mod looks for node on PATH, then in the usual install locations on macOS (Homebrew), Linux and Windows.
  • Works on macOS, Windows and Linux.

Install

claude plugin marketplace add omeraltinova/claude-usage-footer
claude plugin install usage-footer@claude-usage-footer

Then start a new session, or run /reload-plugins in an open one.

Notes

  • Prices are built in (plugins/usage-footer/scripts/usage-scan.mjs, PRICES) and need updating when Anthropic's prices change.
  • Usage on claude.ai (web, mobile) is not in the local transcripts, so it is not counted in the dollar figures; the limit percentages come from your account and do include it.
  • The Desktop app cuts the footer at a fixed width, so the footer stays short; the card has the details.

License

MIT

関連作品