arafathusayn/cc-mods/tree/main/mods/usage-meter
usage-meter
프롬프트 위 한 줄에 플랜의 5시간 및 주간 사용량 한도와 각 재설정까지 남은 시간을 표시합니다. `/usage-meter`를 실행하면 사용 속도와 언제 소진될지를 보여 주는 창이 열립니다.
이 mod 소개
구독 사용량 창(5시간, 전체 모델 주간, 모델별 주간)을 프롬프트 위 한 줄에 계속 표시하고 50%와 75%에 색상 임계값을 두는 Claude Code 플러그인입니다. /usage-meter로 상세 창을 전환하면 막대, 재설정 시각과 카운트다운, 최근 속도, 창이 재설정 전에 소진될지 아니면 끝까지 유지될지를 보여 줍니다. 5시간 및 주간 창의 수치는 각 응답에서 가져오며, 모델별 주간 수치는 응답 후 최대 5분마다 계정 사용량 요청에서 읽습니다. claude plugin marketplace add arafathusayn/cc-mods와 claude plugin install usage-meter@cc-mods로 설치합니다. Claude Code 2.1.289에서 테스트되었습니다.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add arafathusayn/cc-mods claude plugin install usage-meter
원문 / README
usage-meter
Your Claude subscription has usage limits: a 5-hour window, a weekly window for all models, a
weekly window for a model your plan counts on its own (such as Fable) and, on a Claude gateway, a
spend limit. Claude Code mentions them only once you are close. usage-meter keeps them on screen
the whole session, as one line at the right side above the prompt:
5H 14% 2h 55m │ WK 76% 4d 0h │ Fable 30% 4d 0h
Each entry is a window: how much of it is used, and how long until it resets. A model's own week carries the model's name. The percent turns yellow from 50% and red from 75%. The line appears once Claude has replied for the first time in a subscription session; a session on an API key has no usage limits, so nothing is drawn.
/usage-meter opens a pane with more for each window: a bar drawn to the pane's width, the reset
as a clock time and a countdown, your recent pace, and where that pace leads:
5-hour limit · 14% used
█████░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░░
resets 15:00 (in 2h 55m)
pace 6.0%/h over the last 1h 0m
at this pace: lasts until the reset
Run /usage-meter again to close it.
Install
claude plugin marketplace add arafathusayn/cc-mods
claude plugin install usage-meter@cc-mods
Where the figures come from
- The 5-hour and the all-models weekly windows come with every reply: Claude Code passes them on
(
session.measure), so the meter asks nothing for them. - A model's own week is not in the replies. The meter reads it from your account's usage, the same
request
/usagemakes, at most every five minutes after a reply and every quarter hour while the session sits idle. It asks with the session's own login through Claude Code, which keeps the credential and sends it to Anthropic alone; the mod never sees it. A session without a Claude login (an API key, a gateway) asks nothing. - That request is the one Claude Code itself uses, not a published API. Should its answer change shape, the model weeks are left out and the rest of the meter carries on.
How the pace is worked out
- The meter keeps the moments a window's use changed, so the pace survives a restart inside the same window.
- The pace is the change in use over the last fifth of the window (an hour of the 5-hour window, a little under a day and a half of the weekly one), or over everything seen when that is shorter.
- No pace is quoted until the meter has watched a twentieth of the window (15 minutes of the 5-hour window, about 8.4 hours of the weekly one): use moves in steps of about a point, and one step over a few minutes would read as many times the real pace. Until then the pane says when it will know.
- Where the pace leads:
runs out in ~2h 5mwhen the window fills before it resets,lasts until the resetwhen the reset comes first,not risingwhen use has not moved. - A new window is recognised by a reset time that moved, a reset time that passed, or use that fell; the old window's history is dropped.
Develop
claude --plugin-dir mods/usage-meter
hooks/register.tsx is the only file that touches $: it builds the ports the use cases in
hooks/actions.ts run on and wires the events. The rest is pure: reading.ts and
account-usage.ts decode what the engine and the account's usage report, track.ts and
meter.ts keep the history, forecast.ts works out the pace, wording.ts writes the text,
band.tsx and pane.tsx draw.
Inspired by quota-meter from claude-mods (MIT); written anew here.
Tested with Claude Code 2.1.289.
동명의 다른 작품
- usage-meterhamzafer · ★ 91
- usage-metermishgoldenberg · ★ 3
- usage-meterLeeHigma0201 · ★ 3
- usage-metereshin087 · ★ 0
- usage-meterPimzino · ★ 0
- usage-meter0xGondarxyz · ★ 0

