gmorubio/claude-mods/tree/main/turn-usage
この mod について
各 Claude の返信の下に薄い行を表示し、現在のセッション使用量制限の使用率と、直前に終わったターンの使用量を示します。
Session: 39% used · this turn: <1%
「current session」の値は 5 時間の使用量ウィンドウです。Claude の使用量設定で「Current session」と呼ばれているものと同じです。
従量課金(API key、Bedrock、Vertex)には使用量ウィンドウがありません。そのため /cost の集計と同じように、セッションとターンのコストを米ドルで表示します。
Session: $1.84 · this turn: $0.12
表示の読み方
サブスクリプションでは次のようになります。
| 表示 | 意味 |
| --- | --- |
| this turn: +2% | ターン中にセッションの値が 2 ポイント上がった |
| this turn: <1% | ターンによるセッションの変化が 1 ポイント未満だった |
| this turn: — | 比較する値がない:セッションの最初のターンが読み取り前に終了した |
サブスクリプションのウィンドウ(5 時間または週次)が使い切られた後も完了するターンは追加使用量で実行されるため、ポイントではなくそのターンのコストを表示します。
Session: 100% used · this turn: $0.12 (extra usage)
100% をまたぐターンまではポイントで測定され、コスト表示になるのは次のターンからです。
従量課金と追加使用量では、1 セント未満のターンは <$0.01 と表示します。コストはトークンと公開 API 価格から Claude Code が推定したものです。請求通貨に関係なく常にドル表示で、請求書の金額ではありません。
セッションの最初のターンには、その前の読み取りがありません。値は API レスポンスで初めて届くためです。5 時間ウィンドウがそのターンで始まった場合は 0% から開始し、そうでなければ最初のリクエストに付いた読み取りを代わりに使います。そのため欠けるのはその 1 リクエストだけです。
使用量の値は API のレート制限ヘッダーから取得します。ヘッダーは整数ポイントを報告するため、ターンの割合もその精度です。+1% は、小さなターンがたまたま 1 ポイントをまたいだだけかもしれません。この値はアカウント単位なので、同時に動いている他の Claude セッションも加算されます。
言語
この行は英語で表示されます。Claude Code の language 設定がスペイン語(~/.claude/settings.json の "language": "spanish")の場合はスペイン語です。
Sesión: 39% usado · este turno: <1%
要件
- Claude サブスクリプションまたは従量課金で使う、デスクトップアプリまたはターミナルの Claude Code。
- function-hook mod に対応した Claude Code ビルド(
hooks/hooks.jsonにmodulesがあるもの)。
インストール
シェルで実行します。
claude plugin marketplace add gmorubio/claude-mods
claude plugin install turn-usage@claude-mods
Claude Code のセッション内から一度に実行することもできます。
/plugin install turn-usage --marketplace gmorubio/claude-mods
または、1 つのセッションでローカル checkout から読み込みます。
claude --plugin-dir /path/to/claude-mods/turn-usage
仕組み
hooks/register.tsx が mod 全体です。ターンの開始時と完了時に 5 時間ウィンドウ(なければセッションのコスト)を読み取り、返信の最終テキストと使用量の行を保持します。デスクトップまたはターミナルが返信のテキストブロックを描画するとき、その返信を終えるブロックの下に行を追加します。
プライバシー
turn-usage はネットワークにリクエストを送らず、どこにもデータを送信しません。プライバシーポリシー を参照してください。
ライセンス
インストール
まず作者の README で marketplace とプラグイン名を確認してください。コマンドはリポジトリの構成によって変わる場合があります。
claude plugin marketplace add gmorubio/claude-mods claude plugin install turn-usage
原文 / README
turn-usage
A dim line under each Claude reply that shows how much of your current session's usage limit is used, and how much the turn that just ended spent:
Session: 39% used · this turn: <1%
The "current session" figure is the five-hour usage window, the same one Claude's usage settings call "Current session".
On pay as you go (an API key, Bedrock or Vertex) there is no usage window, so the line shows what the session and the turn cost instead, in US dollars, as /cost counts it:
Session: $1.84 · this turn: $0.12
How it reads
On a subscription:
| Shown | Meaning |
| --- | --- |
| this turn: +2% | The session figure rose 2 points during the turn |
| this turn: <1% | The turn didn't move the session figure a whole point |
| this turn: — | Nothing to compare against: the session's first turn ended before any reading came |
Once a subscription window (the five-hour or the weekly one) is used up, a turn that still completes ran on extra usage, so the line shows that turn's cost instead of its points:
Session: 100% used · this turn: $0.12 (extra usage)
The turn that crosses 100% is still measured in points; the cost shows from the next one.
On pay as you go and extra usage, a turn under a cent shows <$0.01. The cost is Claude Code's estimate from the tokens and the public API prices, always in dollars whatever your billing currency, not your invoice.
A session's first turn has no reading from before it, since the figure only arrives with an API response. If the five-hour window began with that turn, the turn started it at 0%; otherwise the reading that came with the turn's first request stands in, which leaves out only that one request.
The usage figure comes from the API's rate-limit headers, which report whole percentage points, so a turn's share is only as precise as that: a +1% can be a smaller turn that happened to cross a point. The figure is your account's, so other Claude sessions running at the same time count towards it too.
Language
The line is in English, or in Spanish when Claude Code's language setting is Spanish ("language": "spanish" in ~/.claude/settings.json):
Sesión: 39% usado · este turno: <1%
Requirements
- Claude Code in the desktop app or the terminal, on a Claude subscription or pay as you go.
- A Claude Code build with function-hook mods (
hooks/hooks.jsonwithmodules).
Install
In your shell:
claude plugin marketplace add gmorubio/claude-mods
claude plugin install turn-usage@claude-mods
Or both at once from inside a Claude Code session:
/plugin install turn-usage --marketplace gmorubio/claude-mods
Or load it from a local checkout for one session:
claude --plugin-dir /path/to/claude-mods/turn-usage
How it's built
hooks/register.tsx is the whole mod. It reads the five-hour window (or, with none, the session's cost) when a turn starts and again when it completes, keeps the reply's final text with its usage line, and when the desktop or the terminal draws a reply's text block, adds the line under the block that ends that reply.
Privacy
turn-usage makes no network requests and sends nothing anywhere. See the privacy policy.
