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

usage-tracker

サブスクリプションプランとセッション/週の使用量ウィンドウをしきい値トースト付きで下部グリッドに表示するClaude Codeプラグインです。

Lunik@Lunik

Lunik/gmz-claude-marketplace/tree/master/usage-tracker

翻訳済み

この mod について

usage-trackerはClaude Codeマーケットプレイスのプラグインで、右下グリッドの行にclaude auth statusから読んだプランと、5時間セッション・7日間の週使用量バーを描画します。バーは10セルで、80%/90%で緑/オレンジ/赤に変わり、各しきい値を初めて越えたときにトーストを出します(リセット後に再武装)。セッションはモデルリクエストごと、週とプランはターンごとに更新します。起動時にはAnthropic OAuth使用量エンドポイントを問い合わせ、空のウィンドウを事前入力します(トークンは子python3プロセスでmacOSキーチェーンから読み、api.anthropic.comにだけ送信)。レスポンス後はエンジン自身の値に置き換わります。macOS以外、または取得失敗時は、最初のレスポンスまでバーを-のままにします。

インストール

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

claude plugin marketplace add Lunik/gmz-claude-marketplace
claude plugin install usage-tracker
原文 / README

usage-tracker

Shows your Claude subscription plan and how much of the 5-hour (session) and 7-day (week) usage windows you have used.

Claude Pro ┃ session ▰▰▰▱▱▱▱▱▱▱ 32% ┃ week ▰▰▰▰▰▰▰▰▱▱ 82%

Behavior

  • Row in the bottom-right grid. Bars have 10 cells, colored green below 80%, orange from 80%, red from 90%.
  • Toast when a window first crosses 80% and again at 90%. The toast rearms after the window resets.
  • The plan label comes from claude auth status (Claude Pro, Claude Max, ...), Claude if unknown.
  • session refreshes after every model request, week and the plan after every turn.
  • Shows - and empty bars until data is available.

Startup data

Rate limits normally arrive with the first API response. To show them earlier, the plugin queries https://api.anthropic.com/api/oauth/usage at session start and on the first render:

  • The OAuth token is read from the macOS keychain (Claude Code-credentials) inside a child python3 process, so it never appears in a command line, and is sent only to api.anthropic.com.
  • Values from this call only fill empty windows. The engine's own figures replace them once a response arrives.
  • On other platforms, or if the lookup fails, the bars stay at - until the first response.

Requirements

claude on PATH (plan lookup). macOS and python3 for the startup fetch.

関連作品