leonardokidd/cc-usage
cc-usage
一个 Claude Code 状态行插件,显示方案用量、重置倒计时、会话 token、费用和实时每秒 token,并提供经过验证的清单和钩子。
关于这个 mod
cc-usage 是一个 Claude Code 状态行插件,以固定宽度格式显示 5 小时和 7 天方案用量及重置倒计时、会话的输入和输出 token、以 USD 计的会话费用,以及实时输出 token 每秒数。它同时适用于桌面应用的 Code 标签页和 CLI。通过 /plugin marketplace add leonardokidd/cc-usage 和 /plugin install cc-usage@cc-usage 安装;需要 Claude Code 2.1.286 或更高版本。命令包括 /usage-bar(切换状态行)和 /usage-bar raw(显示原始速率限制与费用数值)。用量字段需要 Claude 订阅;数值为只读,且只涵盖主对话。
安装
请先查看作者 README 确认 marketplace 和插件名称;命令可能随仓库结构改变。
claude plugin marketplace add leonardokidd/cc-usage claude plugin install cc-usage
原文 / README
cc-usage
A Claude Code status line showing your plan usage, tokens, cost and live speed. Works in the desktop app's Code tab and the CLI.
cc-usage ⏳ 5% | 2h 11m 📅 1% | 5d 6h ⬆️ 99.9k ⬇️ 6.2k 💵 10.6 ⚡ 𝟷𝟺𝟺.𝟶 t/s
| Field | Meaning | |---|---| | ⏳ | 5-hour limit used, and time until it resets | | 📅 | 7-day limit used, and time until it resets | | ⬆️ | Input tokens sent this session (fresh input plus prompt-cache reads and writes, summed over every request) | | ⬇️ | Output tokens this session; counts up live while Claude replies | | 💵 | Session cost in US dollars | | ⚡ | Output tokens per second; live while Claude replies, then the exact figure for the last reply. Fixed width (monospace digits) so the line does not shift as it updates |
Install
In Claude Code:
/plugin marketplace add leonardokidd/cc-usage
/plugin install cc-usage@cc-usage
Requires Claude Code 2.1.286 or newer (function-hook plugins, an early-access feature that may change between releases).
Commands
/usage-barshows or hides the line./usage-bar rawprints the raw rate-limit and cost figures Claude Code hands the plugin.
Notes
- Usage figures need a Claude subscription. Off a subscription the ⏳ and 📅 fields show
--. - Usage can lag Settings → Usage by up to one reply. The figures arrive with each API response, so use in other chats appears after this session's next reply.
- Percentages are whole numbers. Claude Code reports whole points, so they can differ from Settings by 1.
- ⬆️ and ⬇️ cover the main conversation only. Subagent turns pass through uncounted.
- Read-only. The plugin observes the session and adds one status line; it does not change prompts, tool calls, replies or anything else Claude Code draws.
License
MIT. See LICENSE.
