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

session-band

ターミナルとデスクトップアプリの Code タブで、Claude Code のプロンプト直上にセッション情報を表示します。

crane-valley@crane-valley

crane-valley/claude-plugins/tree/main/plugins/session-band

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

この mod について

  • キャッシュ:メインスレッドのプロンプトキャッシュが期限切れになるまでの時間です。キャッシュを読み書きした最後のメインスレッドリクエストの開始時点から数えます。生成時間もキャッシュの有効期間に含まれるためです。セッションを再開またはフォークした後、プラグインが持っているのはリクエスト開始時刻ではなく、最後のレスポンスが完了した時刻(Claude Code の SessionStart フィールド seconds_since_last_response)だけです。そのため復元されたカウントダウンは推定値で、最大でそのレスポンスの生成時間分だけ長く動くことがあります。次にキャッシュを読み書きするメインスレッドのレスポンスが正確なカウントダウンに置き換えるまで、薄い色で estimated とともに表示されます。たとえば 4:00 estimated のように表示されます。再開時に Claude Code がプロンプトキャッシュの期限切れが近いと報告した場合は、代わりに行へ expired と表示されます。
  • セッション:セッションの API 料金ベースのコストと、実行時間です。
  • 制限:API が報告する各レート制限ウィンドウを、使用量バーとリセットまでの時間付きで表示します。プラグインが名前を付けていないウィンドウ(たとえば組織の支出上限)は、元の種類の名前で表示されます。セッションの最初のレスポンスが値を報告するまで、この行は非表示です。Enterprise シートのように使用クレジットで課金されるプランは、レスポンスでウィンドウを報告しません。showCredits を有効にすると、月間クレジット使用額を Credits として追加します。これはセッション開始時に読み取られるため、レスポンスがまだなくても有効にすれば行が表示されることがあります。
  • コンテキスト:コンテキストウィンドウの使用量を、/context の色で示される最大のカテゴリに分けて表示します。

要件

Function hooks は Claude Code のアーリーアクセス API であり、リリース間で予告なく変更される可能性があります。CI は Claude Code 2.1.288 でこのプラグインをテストします。バンドが表示されない場合は Claude Code を更新してください。function hooks がまだデフォルトで無効なビルドでは、環境に CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 が必要です。

インストール

claude plugin marketplace add crane-valley/claude-plugins
claude plugin install session-band@crane-valley

オプション

/plugin configure session-band@crane-valley を使うか、/config で設定するか、claude plugin install に --config KEY=VALUE を付けて設定します。設定しないオプションは以下のデフォルト値になります。

| オプション | デフォルト | 意味 | | --- | --- | --- | | cacheTtl | 5m | メインスレッドが使うプロンプトキャッシュ TTL(5m または 1h)。プラグインは Claude Code からこの値を読めないため、誤った値ではカウントダウンも誤ります。 | | showCost | true | セッションのコストを表示します。サブスクリプションでは、これは使用量の API 料金であり、請求額ではありません。 | | showCredits | false | Claude Code の /usage が Usage credits に表示するアカウントの月間使用クレジット額を、Limits 行に追加します。プラグインはあなたのログイン情報で同じエンドポイントを最大 5 分ごとにリクエストします。エンドポイントは未文書化のため、変更されたりエラーを返したりすると行を省きます。リセット時刻は返されないため表示しません。claude.ai のログインが必要です。Bedrock、Vertex、ゲートウェイ、API key ではプラグインはリクエストを送らず、Credits も表示しません。 |

バンドの共有

プロンプト上のバンドは、すべてのプラグインが共有する 1 つのスロットです。session-band は下のプラグインが描画した内容に自分の行を追加するため、他のプラグインの行も表示されます。next(e) を呼ばずにバンドを描画するプラグインがあると、その下にある内容は隠れます。

ライセンス

MIT

インストール

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

claude plugin marketplace add crane-valley/claude-plugins
claude plugin install session-band
原文 / README

session-band

Session figures in the band directly above the Claude Code prompt, on the terminal and in the desktop app's Code tab:

session-band in the desktop app's Code tab

  • Cache: time left before the main thread's prompt cache expires, counted from the start of the last main-thread request that read or wrote the cache, since generation time counts against the cache lifetime. After a session is resumed or forked, the plugin has no request start time, only the time the last response finished (Claude Code's SessionStart field seconds_since_last_response), so the restored countdown is an estimate that can run long by up to that response's generation time and is shown followed by the word estimated in dim text, for example 4:00 estimated, until the next main-thread response that reads or writes the cache replaces it with the exact countdown. When Claude Code reports on resume that the prompt cache has likely expired, the row shows expired instead.
  • Session: the session's API-priced cost and how long it has run.
  • Limits: each rate-limit window the API reports, with a usage bar and the time to its reset. Windows the plugin does not name (an organization spend limit, for example) show under their raw kind. The row is hidden until the first response of the session reports a reading. Plans billed in usage credits, such as Enterprise seats, report no window on responses; turn on showCredits to add their monthly credit spend as Credits, which is read when the session starts, so with it the row can show before any response.
  • Context: the context window fill, split by the largest categories in /context's colors.

Requirements

Function hooks are an early-access Claude Code API that may change between releases without notice. CI tests this plugin on Claude Code 2.1.288. If the band does not appear, update Claude Code; a build where function hooks are still off by default needs CLAUDE_CODE_ENABLE_FUNCTION_HOOKS=1 in its environment.

Install

claude plugin marketplace add crane-valley/claude-plugins
claude plugin install session-band@crane-valley

Options

Set them with /plugin configure session-band@crane-valley, in /config, or with --config KEY=VALUE on claude plugin install. Unset options take the defaults below.

| Option | Default | Meaning | | --- | --- | --- | | cacheTtl | 5m | The prompt cache TTL your main thread uses (5m or 1h). The plugin cannot read it from Claude Code, so a wrong value shows a wrong countdown. | | showCost | true | Show the session's cost. On a subscription this is the API price of the usage, not what you are billed. | | showCredits | false | Add the account's monthly usage-credit spend to the Limits row, as Claude Code's /usage shows it under Usage credits. The plugin asks the same endpoint with your own login at most every 5 minutes. The endpoint is undocumented, so when it changes or answers with an error the row is left out. It carries no reset time, so none is shown. It needs a claude.ai login: on Bedrock, Vertex, a gateway or an API key the plugin sends no request and shows no Credits. |

Sharing the band

The band above the prompt is one slot shared by every plugin. session-band appends its rows to whatever the plugins beneath it drew, so other plugins' rows stay visible; a plugin that draws the band without calling next(e) hides the ones beneath it.

License

MIT

同名の他の作品

関連作品