HN 표시: Luigis-meter – 상태 표시줄에 Claude Code Max 할당량 표시

hackernews | | 📦 오픈소스
#ai 딜 #anthropic #api 할당량 #claude #claude code #cli #개발 도구 #상태 표시줄
원문 출처: hackernews · Genesis Park에서 요약 및 분석

요약

루이지스 미터(luigis-meter)는 Claude Code Max 사용자를 위해 터미널 상태 표시줄에서 세션(5시간) 및 주간 토큰 사용량을 실시간으로 추적해주는 로컬 오픈소스 도구입니다. 기존의 흐름을 방해하는 '/usage' 명령어 대신, 로컬에 저장된 JSONL 기록 파일을 분석하여 남은 토큰 비율과 초기화 시간을 색상 코드(녹색, 노란색, 빨간색)로 직관적으로 보여줍니다. 서버와 통신하지 않고 입력 및 출력 토큰만 합산하여 계산하므로 API 호출 비용이 발생하지 않으며, 기본값은 Max 20x 티어(약 192K/5시간, 3.25M/주)에 최적화되어 있지만 환경 변수를 통해 다른 요금제로 재조정할 수도 있습니다.

본문

[!powered by luigis-meter](https://github.com/Luigigreco/luigis-meter) Know exactly how much Claude Code runway you have — 5h session and weekly — before the /usage popup would tell you. Statusline-native, calibratable, MIT. luigis-meter is a terminal-native quota indicator for Claude Code Max users. It reads your local transcripts, estimates how much of your 5-hour session and weekly Max plan quota is still available, and surfaces it right in your statusline. No more /usage popup hunting. Claude Code's built-in /usage popup is great — but it's a popup. You have to interrupt your flow, type a command, read numbers, close it. If you work intensely enough to hit Max plan limits, you want that information always visible, not one keystroke away. luigis-meter puts the gauge where you already look: your statusline. - ⏱ Session 5h remaining — with countdown to reset - 📅 Weekly remaining — with reset day/time - 🎨 Color-coded — green (safe), yellow (watch), red (danger) - 🚀 Fast — 30s cache, /dev/null) And after the final echo : [ -n "$METER_LINE" ] && echo -e "$METER_LINE" If you don't have a statusline.sh yet, see examples/statusline.sh.example for a minimal starting point. luigis-meter ⏱ sess left: 85% (2h 13m left) · week left: 39% (reset Fri 14:00) · estimate | Part | Meaning | |---|---| lm | brand prefix — this is luigis-meter | ⏱ | visual marker for the meter line | sess left: N% | percent of the 5-hour session block remaining | (Nh Nm left) | time until the current 5-hour block resets | week left: N% | percent of the weekly quota remaining | (reset Fri HH:MM) | next weekly reset | estimate | reminder that these are local estimates | Colors follow "remaining" semantics: green >50%, yellow 20-50%, red <20%. These defaults were calibrated from real Max 20x usage and match Claude Code's /usage popup within ~2% on the tester's setup: CLAUDE_MAX_5H_TOKENS=192000 # ~192K tokens per 5h block CLAUDE_MAX_WEEKLY_TOKENS=3250000 # ~3.25M tokens per week If the numbers drift for you, see CALIBRATION.md for the retuning procedure, and consider sharing your tuned values via the calibration issue template. Q: Why does my sess left show high % but (0h 0m left) or (resetting...) ? A: Not a bug. Claude Code's 5-hour session block starts from your first message in the current window and closes 5 hours later regardless of how much you used. If you sent one message 4h59m ago and then nothing, you'll see high "remaining" but imminent reset. This matches the /usage popup exactly. Q: Why are the defaults tuned for Max 20x specifically? A: That's the tier the original author uses. Max 5x and Pro users should expect the defaults to drift significantly — please retune via CALIBRATION.md and consider opening a calibration issue so the community can converge on per-tier defaults. Q: Is the weekly reset really on Fridays? A: Anthropic uses a rolling 7-day window under the hood, but the /usage popup displays "Resets Fri HH:MM" as a human-friendly approximation. luigis-meter mirrors that format for familiarity. The number of tokens used in the last 7 days is what actually matters, not the exact day. Q: Why don't you count cache_read_input_tokens ? A: Cache tokens are heavily discounted in real Anthropic billing (Claude Code uses prompt caching aggressively). Including them would inflate percentages 10-20x and make the meter wildly wrong. Only input_tokens + output_tokens are counted. Q: Can this push me over the limit faster by running frequently? A: No. The script only reads local JSONL files that already exist. It makes zero API calls to Anthropic. Running it every second costs nothing. Q: What if Anthropic changes the Max plan limits? A: The hardcoded defaults will go stale. Either wait for a new release that updates them, or retune via env vars yourself. Calibration issues are the mechanism for catching drift quickly. luigis-meter scans ~/.claude/projects/**/*.jsonl (Claude Code's local transcript files), sums input_tokens + output_tokens from the last 5 hours and 7 days, and divides by the quota limits. This is not a connection to Anthropic's servers. It's a local estimate based on data Claude Code already writes to disk. Quality depends on calibration. .message.usage.input_tokens .message.usage.output_tokens cache_read_input_tokens (heavily discounted in real billing)cache_creation_input_tokens (one-off, distorts short windows)- Tool call overhead and server tool tokens (not exposed in transcripts) - Not authoritative: Anthropic's /usage popup uses server-side data. This tool uses local transcripts. They can diverge. - Weekly reset is approximated: Anthropic uses a rolling 7-day window. - Limits drift over time: If Anthropic changes Max plan quotas, the hardcoded defaults will go stale. Recalibrate periodically. - Single-tier counting: Sonnet and Opus tokens are summed together. Using luigis-meter? Add this badge to your README and give the tool a home on your projects: [!powered by luigis-meter](https://github.com/Luigigreco/luigis-me

Genesis Park 편집팀이 AI를 활용하여 작성한 분석입니다. 원문은 출처 링크를 통해 확인할 수 있습니다.

공유

관련 저널 읽기

전체 보기 →