jimmyeao/claude-code-bars/tree/main/plugins/usage-bar
GitHub 저장소 · 작성자 jimmyeao
usage-bar
플랜 사용량 제한을 프롬프트 위에 시간 창별 색상 막대로 표시하고, 시계가 진행되는 속도보다 빠르게 사용하는 창을 표시합니다. `/usage-bar`로 전환합니다.
jimmyeao@jimmyeao
이 mod 소개
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 응답의 속도 제한 창과 세션 비용을 읽습니다.- 각 프롬프트와 턴이 끝난 뒤 새로 고치고, 카운트다운이 계속 움직이도록 1분마다도 갱신합니다.
AbovePrompt밴드에 그리며, 그곳에 그리는 다른 밴드 위에 표시합니다. 설문이 표시되는 동안에는 비켜 둡니다.
제한
- 엔진이 보고하는 창만 표시합니다. 모델별 행(예: Sonnet만)은 없으므로
/usage의 모든 줄과 일치하지 않습니다. - 구독 플랜을 사용하지 않으면 그릴 제한이 없으며 "No plan limits reported for this account."라고 표시합니다.
- 창 길이는 5시간과 7일이라고 가정합니다. 창이 정확히 그 길이가 아니면
% of time은 근사값입니다.
설치
먼저 작성자의 README에서 marketplace와 플러그인 이름을 확인하세요. 저장소 구조에 따라 명령어가 달라질 수 있습니다.
claude plugin marketplace add jimmyeao/claude-code-bars claude plugin install usage-bar
원문 / 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), andSpendfor 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 timeis 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
% usedamber and addsN 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
AbovePromptband, 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 timeis approximate.
