ClaudeMods
☰
ZH-TW
● — 人在線上 · 瀏覽 — 次
贊助提交作品
GitHub 儲存庫 · 發布者 andrej-kolic

usage-bar

Claude Code 外掛,在提示字元上方以一行安靜的資訊顯示方案用量限制、上下文填充和工作階段費用,並在 50%、80% 和 95% 處提供黃色/紅色閾值警示,每個限制週期重置。

andrej-kolic@andrej-kolic

andrej-kolic/claude-mods/tree/main/plugins/usage-bar

原貼文圖片1
已翻譯

關於這個 mod

usage-bar 在 Claude Code 的提示字元上方新增一行精簡的資訊,是對狀態列的補充而非取代。左側顯示目前對話的上下文視窗填充情況和工作階段費用;右側顯示帳戶的 5 小時工作階段和每週限制用量以及距重置的時間。限制百分比在 50% 時變成黃色,在 95% 時變成紅色,並在 50%、80% 和 95% 閾值處顯示警示,每個限制週期僅顯示一次,並在重新啟動和不同專案之間保持。當空間緊繃時,該行會逐步縮短而不是換行,在首次讀取之前或登出狀態下顯示 "usage: no data yet"。

它只讀取 Claude Code 已提供的數字,不向任何地方傳送任何內容,也不發起網路請求,僅在本機儲存已顯示警示的小記錄。使用 /plugin install usage-bar --marketplace andrej-kolic/claude-mods 安裝;需要 Claude Code 2.1.275 或更高版本,並增加約 0 個 token 的上下文。用量限制需要 Claude 訂閱;使用 API 金鑰時僅顯示上下文和費用。它適用於終端機和桌面應用程式的 Code 索引標籤,不適用於 claude.ai 或 Cowork。

安裝

請先查看作者 README,確認 marketplace 與外掛名稱;指令可能隨儲存庫結構而變動。

claude plugin marketplace add andrej-kolic/claude-mods
claude plugin install usage-bar@claude-mods
原文 / README

usage-bar

Your plan's usage limits, context and cost on one quiet line above the prompt, with an alert before you run out. It doesn't replace your status line: it sits above the prompt, so the two work side by side.

The bar above Claude Code's prompt: context 62% · $1.84 on the left, session 41% (↻ 2h10m) · week 18% (↻ 3d2h) on the right

On the left, this conversation:

  • context: how full the context window is.
  • $: what this session has cost.

On the right, your account's limits:

  • session and week: how much of your 5-hour and weekly limits you've used, and after ↻, how long until each resets: 2h10m, 3d2h, or now once it has reset.

Alerts

A limit's percent turns yellow at 50% and red at 95%; the rest of the line stays grey. An alert with the limit and its percent appears at the top right at 50%, 80% and 95%:

The session limit at 55% in yellow, with the alert "session 55%"

The weekly limit at 96% in red, with the alert "week 96%"

When both limits cross at once, one alert names both: session 62% · week 97%. Each alert shows once per limit period, even across restarts and projects. When a limit resets, its alerts start over.

When the line doesn't fit

The line at the top is the full layout. When it doesn't fit, it shortens instead of wrapping, one step at a time:

ctx 62% · $1.84    s ⣿⣿⣿⣀⣀⣀⣀⣀ 41% (↻ 2h10m) · w ⣿⣀⣀⣀⣀⣀⣀⣀ 18% (↻ 3d2h)
ctx 62% · $1.84    s 41% (↻ 2h10m) · w 18% (↻ 3d2h)
ctx 62% · $1.84    s 41% · w 18%

Before the first reading

For a few seconds after startup, and for as long as you're not logged in, the line reads:

usage: no data yet

The context shows – until your first reply, because Claude Code measures the context only when it answers.

What it is not

  • Not a status line. It sits above the prompt and leaves your status line alone.
  • Not a usage history. It shows the current figures and nothing over time.

Privacy

usage-bar reads only figures Claude Code already has: context fill, session cost and your plan's limits. It sends nothing anywhere and makes no network requests. It stores one small record per limit on your machine, listing the alerts already shown in the current period, so a restart doesn't repeat them.

Install

In Claude Code:

/plugin install usage-bar --marketplace andrej-kolic/claude-mods

The desktop app's Code tab doesn't offer /plugin install: run it once in a terminal, at the user scope, and the line shows in the desktop app's local sessions too.

  • Claude Code: 2.1.275 or later for this one-step install. Tested on 2.1.295 and 2.1.296 in the terminal, and in the desktop app 2.31226.0.
  • Plan: usage limits need a Claude subscription. With an API key, the line shows only the context and $, and no alerts.
  • Context cost: about 0 tokens. It adds nothing to what Claude reads.
  • Where it shows: Claude Code's terminal and the desktop app's Code tab. It does nothing on claude.ai or in Cowork.

More

The screenshots use sample readings. The yellow and red follow your Claude Code theme.

The spec has every rule: rounding, colours, widths, and when alerts repeat.

其他同名作品

更多類似作品