---
title: "usage-bar"
url: "https://claudemods.dev/zh-cn/builds/usage-bar-2760b5"
source: "https://github.com/jimmyeao/claude-code-bars/tree/main/plugins/usage-bar"
source_type: "github"
repo: "https://github.com/jimmyeao/claude-code-bars/tree/main/plugins/usage-bar"
author: "jimmyeao"
author_handle: "jimmyeao"
stars: 0
category: "仪表盘与 HUD"
categories: ["hud"]
tags: ["above-prompt", "cost", "hooks", "plugin", "rate-limits", "statusline", "usage"]
permission_level: 0
scan_complete: true
install: "claude plugin marketplace add jimmyeao/claude-code-bars\nclaude plugin install usage-bar"
added: "2026-10-05T19:41:59.560Z"
updated: "2026-10-03T15:51:58Z"
locale: "zh-cn"
content_locale: "zh-cn"
---

# usage-bar

将方案用量限制绘制成提示列上方的条形图，每个时间窗口使用一种颜色，并在用量增长速度超过时钟进度时发出标记。使用 /usage-bar 切换。

## Description

# 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` 只是近似值。

## Install

```
claude plugin marketplace add jimmyeao/claude-code-bars
claude plugin install usage-bar
```

## Original 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), and `Spend` for 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 time`** is 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 `% used` amber and adds `N 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 `AbovePrompt` band, 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 time` is approximate.
