jimmyeao/claude-code-bars/tree/main/plugins/usage-bar
GitHub 仓库 · 发布者 jimmyeao
usage-bar
将方案用量限制绘制成提示列上方的条形图,每个时间窗口使用一种颜色,并在用量增长速度超过时钟进度时发出标记。使用 /usage-bar 切换。
jimmyeao@jimmyeao
关于这个 mod
usage-bar
将方案用量限制绘制成提示列上方的条形图,并标记用量增长速度超过时钟进度的时间窗口(示例输出,不是真实数据):
Usage · amber = using a window faster than its clock · session $12.19
Session █████████████████████░░░░░ 79% used · 47% of time · 32 pts ahead of the clock · resets in 2h 40m
Week ███░░░░░░░░░░░░░░░░░░░░░░░ 10% used · 61% of time · resets in 2d 18h
- 每个限制窗口一条条形图:引擎报告的窗口包括
Session(5 小时)、Week(7 天),以及网关消费限制的Spend。颜色表示对应的窗口。实心部分是已使用的额度,阴影部分是剩余额度。 % of time表示窗口已经过去的时间比例,根据它的重置时间计算。- 标记会比较打印出的两个数字。领先超过 5 个百分点时,
% used变为琥珀色,并添加N pts ahead of the clock。领先超过 25 个百分点,或已使用 95% 及以上时,变为红色。没有已知长度的窗口(消费限制)没有时钟,因此只有接近用满时才会标记。 - 工作阶段成本显示在标题行中。
使用
/usage-bar 可以切换它。每个工作阶段开始时默认开启。
工作方式
- 读取
$.session.usage():最近一次 API 响应中的速率限制窗口和工作阶段成本。 - 每次提示和完成一轮后刷新,并且每分钟刷新一次,让倒计时持续推进。
- 在
AbovePrompt区域绘制,位于其他也在该区域绘制的分段之上。显示调查时会暂时让开。
限制
- 只显示引擎报告的窗口。没有按模型拆分的行(例如仅 Sonnet),所以不会与
/usage的每一行都匹配。 - 不使用订阅方案时没有可绘制的限制,并显示 “No plan limits reported for this account.”
- 假定窗口长度为 5 小时和 7 天。如果窗口并非完全这么长,
% of time只是近似值。
安装
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add jimmyeao/claude-code-bars claude plugin install usage-bar
原文 / README
usage-bar
Draws your plan usage limits as bars above the prompt, and flags a window you are using faster than its clock (illustrative output, not real figures):
Usage · amber = using a window faster than its clock · session $12.19
Session █████████████████████░░░░░ 79% used · 47% of time · 32 pts ahead of the clock · resets in 2h 40m
Week ███░░░░░░░░░░░░░░░░░░░░░░░ 10% used · 61% of time · resets in 2d 18h
- One bar per limit window the engine reports:
Session(5 hours),Week(7 days), andSpendfor a gateway spend limit. The colour says which window it is. The solid part is what you have used, the shaded part is what is left. % of timeis how much of the window has already passed, worked out from its reset time.- The flag compares the two printed numbers. More than 5 points ahead turns
% usedamber and addsN pts ahead of the clock. More than 25 points ahead, or 95% used or more, turns it red. A window with no known length (the spend limit) has no clock, so it is flagged only when nearly full. - Session cost appears in the header line.
Use
/usage-bar toggles it. It starts on in every session.
How it works
- Reads
$.session.usage(): the rate-limit windows from the last API response, and the session cost. - Refreshes after each prompt and finished turn, and once a minute so the countdowns keep moving.
- Draws in the
AbovePromptband, on top of whatever other band mods draw there. It steps aside while a survey is showing.
Limits
- It shows only the windows the engine reports. There are no per-model rows (for example Sonnet-only), so it will not match every line of
/usage. - Off a subscription plan there are no limits to draw, and it says "No plan limits reported for this account."
- The 5-hour and 7-day window lengths are assumed. If a window is not exactly that long,
% of timeis approximate.
获取徽章
这是你的项目吗?把这个徽章放进 README 或网站,链接回本页。
Markdown
HTML



