---
title: "usage-bar"
url: "https://claudemods.dev/zh-cn/builds/usage-bar-ac3c7b"
source: "https://github.com/andrej-kolic/claude-mods/tree/main/plugins/usage-bar"
source_type: "github"
repo: "https://github.com/andrej-kolic/claude-mods/tree/main/plugins/usage-bar"
author: "andrej-kolic"
author_handle: "andrej-kolic"
stars: 0
category: "仪表盘与 HUD"
categories: ["hud"]
tags: ["alerts", "context-window", "cost-tracking", "hooks", "hud", "usage-tracking"]
permission_level: 0
scan_complete: true
install: "claude plugin marketplace add andrej-kolic/claude-mods\nclaude plugin install usage-bar@claude-mods"
added: "2026-10-11T14:07:56.861Z"
updated: "2026-10-10T04:25:36Z"
locale: "zh-cn"
content_locale: "zh-cn"
---

# usage-bar

Claude Code 插件，在提示符上方以一行安静的信息显示套餐用量限制、上下文填充和会话费用，并在 50%、80% 和 95% 处提供黄色/红色阈值提醒，每个限制周期重置。

## Description

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。

## Install

```
claude plugin marketplace add andrej-kolic/claude-mods
claude plugin install usage-bar@claude-mods
```

## Original 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](images/normal.png)

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%"](images/yellow.png)

![The weekly limit at 96% in red, with the alert "week 96%"](images/red.png)

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](https://github.com/andrej-kolic/claude-mods/blob/main/docs/usage-bar.md) has every rule: rounding, colours, widths, and when alerts repeat.
