ClaudeMods
☰
ZH-TW
● 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.

更多類似作品