anantraghunath/claude-code-usage-quota-mod

一个 Claude Code mod,会在提示框上方的实时信息条中显示计划限额、重置时间和上下文窗口用量,并支持一键和自动压缩。
anantraghunath/claude-code-usage-quota-mod

这是一个 Claude Code 插件(v0.1.3,MIT),会在桌面版 Code 标签页和终端的提示框上方绘制信息条,显示 5 小时和每周计划限额、重置时的预测,以及按 Messages、Tools 和 Other 拆分的上下文窗口用量。进度条达到 75% 时变为琥珀色,达到 90% 时变为红色(如果按当前速度会耗尽,也可能更早变色)。它提供一键 Compact 按钮,以及按会话设置阈值的 Auto compact 模式(默认 30%,范围 15-99),且不会打断回复。使用 /quota 切换。可通过 GitHub marketplace 使用 /plugin install 安装,也可以使用 claude plugin marketplace add。除定期(约每 2 分钟)使用现有 Claude 登录请求 Anthropic 用量服务外,所有内容都在本地运行;它看不到凭据,也不会向其他地方发送数据。需要较新的 Claude Code,以及 Pro 或 Max 计划。
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add anantraghunath/claude-code-usage-quota-mod claude plugin install claude-code-usage-quota
Know your Claude limits before they hit you. A live band above the Claude Code prompt that shows your plan limits, forecasts whether you'll run out before they reset, and shows how full your context window is. Compact in one click, or let it compact automatically.
The 5 Hour and Weekly limits are your whole Claude account's, including what you use in Claude chat and Cowork. The band itself shows in Claude Code: the desktop app and the terminal.
Type /quota to turn the band off and on.

One row that still shows the time left until each limit resets:

[!TIP] Never hit a full context again: Auto compact, on by one click. With Auto compact on, the band compacts your session once the context reaches 30% (the default; set 15 to 99). A long context costs more on every reply, so compacting early keeps replies cheaper and your limits lasting longer. Auto compact never interrupts a reply. Want to compact right now? The Compact button runs
/compactin one click.Each session keeps its own Auto compact setting, even after a restart, so you can run them differently side by side:
- Building something big? Set Auto compact higher (say 70%) or turn it off, so Claude keeps the whole picture. Press Compact yourself at a good stopping point. (With it off, Claude Code's built-in compaction still steps in when the context is nearly full.)
- Everyday sessions? One click turns Auto compact on at 30%. They stay lean, and your 5 Hour and Weekly limits last longer.
5 Hour and Weekly limits
On course to run out, it warns you and says when you'll hit the limit:


Context window
/context counts it, split into Messages, Tools and Other.Compacting
/compact in one click.If the session is already past your % when you turn it on, it asks first:


/compact, or Claude Code's own), then takes over.Works in light and dark themes and at every width down to the narrowest. Collapsed or expanded is shared across all sessions.
<details> <summary><b>MORE SCREENSHOTS</b></summary>Early in a 5 hour window:


Running out on the Weekly limit:


| Light theme | Narrowest window |
| --- | --- |
|
|
|
|
|
|
[!NOTE] In the desktop app, the band appears once a session has started. The brand-new Welcome back screen has no session yet, so no mod can draw there. Send your first message and it appears.
In the terminal, ▲/▼ expands and collapses it. The [-] next to it is Claude Code's own control and hides the band; ctrl+x ctrl+a brings it back.


Needs a recent Claude Code, signed in with a Pro or Max plan.
Desktop app: in the Code tab, send this as a message, allow the claude plugin command if asked, then quit and reopen the app:
Install the claude-code-usage-quota plugin from the GitHub marketplace anantraghunath/claude-code-usage-quota-mod
Terminal: inside claude, run:
/plugin install claude-code-usage-quota --marketplace anantraghunath/claude-code-usage-quota-mod
Either way installs it for both the desktop app and the terminal.
Update: ask Claude, then restart:
Update the claude-code-usage-quota plugin from its marketplace
Uninstall: in the desktop app, ask Claude:
Remove the claude-code-usage-quota-mod plugin marketplace
or in the terminal:
/plugin marketplace remove claude-code-usage-quota-mod
then restart. This removes it from both. Just want it out of sight? /quota hides it without uninstalling.
claude plugin marketplace add anantraghunath/claude-code-usage-quota-mod; claude plugin install claude-code-usage-quota@claude-code-usage-quota-mod
To update:
claude plugin marketplace update claude-code-usage-quota-mod; claude plugin update claude-code-usage-quota@claude-code-usage-quota-mod
To uninstall:
claude plugin marketplace remove claude-code-usage-quota-mod
</details>
Everything runs on your machine. It reads what Claude Code already has (your context and the limits each reply carries), and about every 2 minutes asks Anthropic's usage service for your limits through your existing Claude login. It never sees your credentials and sends nothing anywhere else. In the desktop app it reads the app's theme setting to match light or dark.
First release: I'd love to hear how it works for you. Open an issue for bugs or ideas. Pull requests welcome.
To work on it, clone the repo, then load it from the folder, or run its tests:
claude --plugin-dir ./claude-code-usage-quota-mod
claude plugin test ./claude-code-usage-quota-mod
If you find it useful, a ⭐ helps others find it.
Inspired by I'm liking the new mods feature on r/ClaudeCode. Thanks to u/itsxzy for sharing the original prompt that started this project.
MIT © 2026 Anant Raghunath