Claude usage meter
Switch Display → Mode to Clawdmeter and the device shows your Claude usage instead of tickers. The data comes from your PC over WiFi. The device’s USB is power only, so no cable runs between it and your PC.
smalltv-mod-firmware-lean.bin does not have this feature. That ESP8266 image compiles it out to free 1,080 bytes of heap, and the web UI hides the tab. Use smalltv-mod-firmware.bin on an ESP8266 that needs the usage meter, or any of the ESP32 images.
What it shows
Section titled “What it shows”The screen has two states:
- Stats, while data arrives: a small mascot, your 5-hour and 7-day usage as large percentages with fill bars that shade from green to amber to red as you approach the cap, and reset countdowns
- Idle animation, when data stops because the PC sleeps, the daemon stops or the network drops: an animated pixel mascot whose mood, from calm to working to dancing, reflects how fast your session is being used up. The stats come back as soon as data returns
Hiding the 5-hour card
Section titled “Hiding the 5-hour card”Plans without a 5-hour limit can drop that card: tick Hide the 5-hour usage card in the Clawdmeter tab and save. The stats screen then shows one tall 7-day card instead of two:
- the 7-day percentage, larger than in the two-card layout
- a thicker fill bar with a white marker at the even pace, the share of the week already elapsed
- the reset countdown
- an “Even pace” line with that share, in amber once your usage runs 5 points or more ahead of it
Even pace is how much of the weekly limit you would have used by now if you spread it evenly over the 7 days. The device computes it from the reset countdown: (7 days minus the time until reset) divided by 7 days. Read the bar against the marker:
- fill ends before the marker: you are below an even spread and have room left
- fill goes past the marker: you are using faster than an even spread, and at this rate you will hit the limit before the reset
For example, 2 days into the week the marker is at 29%. With usage at 45% the fill runs past it and the “Even pace 29%” line turns amber. The marker and the line appear only in the single-card layout.
With the card hidden, the idle animation’s mood follows the 7-day figure instead of the 5-hour one. The setting is stored as usage.hide5h in the device config and is off by default.
The PC-side daemon is a separate project, clawdmeter-daemon. It reads the OAuth token Claude Code has already stored and sends your usage to the device. The token never leaves your machine. The device receives only a few percentages over your LAN.
-
On the PC that runs Claude Code:
Terminal window git clone https://github.com/giovi321/clawdmeter-daemoncd clawdmeter-daemonpip install -r requirements.txt# push to the SmallTV (works even behind WiFi client isolation):python clawdmeter_daemon.py --push-to <smalltv-ip-or-hostname># or serve and let the device pull:python clawdmeter_daemon.py --serve # http://0.0.0.0:8787/On Windows, macOS and Linux it runs with a tray / menu-bar icon and can auto-start at login (
--install). See the clawdmeter-daemon README for tray setup and a durable login token.Use clawdmeter-daemon v1.1.0 or newer. From that release the daemon reads Claude’s usage endpoint instead of spending an inference call per poll, and it reports the session limit as
normal/warning/rejected. This firmware accepts that vocabulary and the olderallowed/allowed_warning/rejectedone. -
In the web UI open Display → Mode → Clawdmeter. Then open the Clawdmeter tab. For push, leave the Usage daemon URL blank. For serve and pull, set it to
http://<that-pc-ip>:8787/. Save
In push mode the daemon posts the usage to POST /api/usage, the one route that stays open when the web UI password is set. HTTP API has the body.
The mascot animations are a selection from the claudepix pixel-art set, re-rendered on the ST7789.
Multiple devices (auto-discovery)
Section titled “Multiple devices (auto-discovery)”Each device advertises a _clawdmeter._tcp mDNS service. The daemon uses it to find every SmallTV on the LAN and push to all of them at once, without a per-device address:
python clawdmeter_daemon.py --pushmDNS is link-local and does not cross routers, subnets or VLANs. If the daemon PC and the devices are on different subnets, do one of these:
- run the daemon on the devices’ subnet
- enable an mDNS reflector between the subnets
- list the device IPs explicitly instead of relying on discovery, with repeatable or comma-separated
--push-to, or via the tray icon’s Configure push targets dialog
Prompt status from Claude Code
Section titled “Prompt status from Claude Code”The stats screen can also show whether Claude Code is working right now. It needs firmware v3.4.0 or later, and clawdmeter-daemon v1.2.0 or later for the one-step setup. It appears in the top-right corner, next to the header:
- Running: three orange dots that hop in turn while a prompt is being processed
- Done: when the prompt finishes, the panel flashes orange with a large
DONEfor 1.5 s. A smallDONEbadge then stays in the corner - Idle: nothing
Claude Code hooks on the PC set the state with POST /api/activity?state=running|done|idle. clawdmeter-daemon installs them in one step:
python clawdmeter_daemon.py --install-hooks # remove again with --uninstall-hooksThe hooks report to the daemon on localhost, and the daemon forwards the state to every device it pushes to, so the hooks need no device address. Open a new Claude Code session afterwards, since hooks load when a session starts.
- The daemon must run with the HTTP push transport. The stats screen needs that anyway, and the idle mascot screen does not show the indicator
- If the web UI password is on,
/api/activityneeds it like every other page. Put it in the daemon’s config (~/.clawdmeter-daemon.json,device_useranddevice_password), not in Claude’s settings - The states time out by themselves, running after 30 minutes and done after 10 minutes, so a missed hook cannot leave the corner stuck
Without the daemon’s installer
Section titled “Without the daemon’s installer”Add two hooks to ~/.claude/settings.json by hand, merged into any hooks you already have. They call the device directly:
{ "hooks": { "UserPromptSubmit": [ { "hooks": [ { "type": "command", "async": true, "command": "curl -s -m 1 -X POST \"http://<smalltv-ip>/api/activity?state=running\" >/dev/null 2>&1 || true" } ] } ], "Stop": [ { "hooks": [ { "type": "command", "async": true, "command": "curl -s -m 1 -X POST \"http://<smalltv-ip>/api/activity?state=done\" >/dev/null 2>&1 || true" } ] } ] }}async: true and -m 1 mean a prompt never waits on the device. With the web UI password on, add --digest -u <user>:<password> to both curl commands. This leaves the password in plain text in settings.json.