usage-meter (rohit3a)
Reviewed
at commit 0c8bc64
Caution: Installs a background collector service that keeps running after Claude Code closes, and keeps the start of your prompts in ~/.claude/usage-meter for 35 days.
Live view of where every token goes: plan limit %, tokens and API-equivalent $, by machine, thread, subagent, task and model
0 upvotes
Log in to upvote or save- Made by
- Rohit
- Pinned commit
-
0c8bc64633c7244d348be53d114e1376fe24e367 - What we checked
-
Shows your plan-limit use, burn rate and estimated API cost in a status line, a band above the prompt and a /burn pane. At session start it installs a background collector (systemd, launchd or a plain process) that keeps running, reads your Claude Code transcripts and Codex logs, and keeps 35 days of usage plus short prompt excerpts in ~/.claude/usage-meter. Nothing is uploaded except an optional SSH sync to your own machines.
Review details
Static review of the source at the pinned commit; not run. Delta review of the changes since 5b07ddd; the rest carries over from the review at that commit. The earlier review: register.tsx, umeter.py, live.py and service.py were read in full, view.py by targeted search. Hooks: session.start, turn.start, agent.spawn, turn.step, tool.call (Bash, only to notice `codex exec` and pass it through unchanged), turn.complete, session.compact, session.measure, session.end, command.run (/burn) and ui.render (AbovePrompt band, Pane). Runtime calls: $.session.usage/id/model, $.ui.status/toast/open/panes/invalidate/log, $.state, $.clock.every(2000), $.fs read of ~/.claude/usage-meter/local/*.json and writes of local/refresh, local/stop/<run>.json and local/limits/<session>.json, and $.process.run of python3 (or python) on the plugin's collector/umeter.py with install/uninstall arguments. With autoStart on (default) every session start runs `umeter.py install --if-needed`, which copies the collector to ~/.claude/usage-meter/app and installs it as an enabled systemd user unit (Restart=always), a launchd agent (RunAtLoad, KeepAlive) or a detached process; it keeps running after Claude Code exits and starts at login until /burn uninstall removes it. The README and the autoStart setting disclose this. The collector reads ~/.claude/projects transcripts, ~/.claude/sessions/*.json, ~/.codex/sessions rollouts and any stream-log folders you list, and writes per-day ledgers with token counts, session titles, working directories and the first 140 characters of each prompt (35 days), plus Codex task and command snippets. It runs `claude auth status --json` hourly for the plan type only, lsof for Codex PIDs, and on the Stop button sends SIGINT then SIGTERM to that Codex process. Idle compaction ($.session.compact, uses tokens) is off by default. Network: none, except rsync/ssh (BatchMode) to peers you configure with `umeter.py config --peer`. The collector imports fcntl, so it does not run on native Windows. No npm dependencies. Changes in this version: performance work in the collector (scan every 10 s instead of 3 s, full directory walk once a minute with only recently written files re-checked in between, state saved every 5 minutes, the limit merge skipped until a session file changes, the parsed ledger freed 5 minutes after the last summary build, cached price lookups, older day files reduced to per-session totals when loaded, Codex step list trimmed to 8); the summary is now rebuilt on demand, so the pane writes local/refresh when it opens and about once a minute while open, and shows 'updating'; the pre-prompt meter reads the percentage from the session's own live reading. No new hosts, files, processes, permissions or installs were added.
- What it uses
-
- Reads your prompts: yes
- Sees tool calls: yes
- Blocks or changes tool calls: no
- Reads or writes files: yes
- Runs programs on your machine: yes
- Calls the model (uses tokens): yes
- Sends data over the network: yes
- Stores data: yes
- Shows something on screen: yes
Made this mod? Add a badge to your README
Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.
[](https://modsforclaude.com/mods/usage-meter-rohit3a/)