Physical desk monitor that displays Claude Code usage limits (5-hour session and 7-day weekly utilization) on an ESP32-S3 touchscreen via USB serial. Firmware: LVGL 9 dashboard with LovyanGFX on SC01 Plus, Anthropic brand colors and custom fonts (Tiempos, Styrene B, DejaVu Sans Mono), Claude spinner animation with rotating status words. Daemon: Pure bash script that reads the Claude Code OAuth token, makes a minimal Haiku API call, extracts usage from rate-limit response headers, and sends JSON to the ESP32 over serial. Uses inotifywait for instant USB plug/unplug detection. Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
3.5 KiB
Claude Usage Tracker - Panlee SC01 Plus
Displays your Claude Code usage limits on a Panlee SC01 Plus (ESP32-S3) 3.5" touchscreen.
Shows your 5-hour session and 7-day weekly utilization.
Hardware
- Panlee SC01 Plus (WT32-SC01 Plus) — ESP32-S3, 3.5" 480x320 IPS, capacitive touch
- USB-C cable for power and data)
Prerequisites
- Linux (tested on my Ubuntu laptop)
- PlatformIO CLI
curl,awk,inotify-tools(pre-installed on most Linux distros, installinotify-toolsif missing)- Claude Code
- User in
dialoutgroup:sudo adduser $USER dialout(log out/in after)
Flash the firmware
cd firmware
pio run -t upload
The SC01 Plus appears at /dev/ttyACM0.
Run the daemon
The daemon polls your Claude usage every 30 seconds and sends it to the display over USB serial.
bash daemon/claude-usage-daemon.sh
Install the systemd service
To auto-start the daemon on login:
./install.sh
Check status: systemctl --user status claude-usage-daemon
How it works
- The daemon reads your Claude Code OAuth token from
~/.claude/.credentials.json - Makes a minimal API call to
api.anthropic.com/v1/messages(1 token of Haiku, essentially free) - Extracts usage data from the response headers (
anthropic-ratelimit-unified-5h-utilization, etc.) - Sends a JSON line over USB serial to the ESP32
- The ESP32 parses it and updates the LVGL dashboard
Recompiling fonts
The firmware/src/font_*.c files are pre-compiled LVGL bitmap fonts. If you need to regenerate them (e.g. to change sizes or add characters):
npm install -g lv_font_conv
Generate with --no-compress (required for LVGL 9):
# Tiempos Text (title)
lv_font_conv --font assets/TiemposText-400-Regular.otf -r 0x20-0x7E \
--size 34 --format lvgl --bpp 4 --no-compress \
-o firmware/src/font_tiempos_34.c --lv-include "lvgl.h"
# Styrene B (UI text)
lv_font_conv --font assets/StyreneB-Regular.otf -r 0x20-0x7E \
--size 28 --format lvgl --bpp 4 --no-compress \
-o firmware/src/font_styrene_28.c --lv-include "lvgl.h"
# DejaVu Sans Mono (animation, with spinner Unicode chars)
lv_font_conv --font assets/DejaVuSansMono.ttf \
-r 0x20-0x7E,0xB7,0x2026,0x2722,0x2733,0x2736,0x273B,0x273D \
--size 18 --format lvgl --bpp 4 --no-compress \
-o firmware/src/font_mono_18.c --lv-include "lvgl.h"
Important: lv_font_conv v1.5.3 outputs LVGL 8 format. Each generated file must be patched for LVGL 9 compatibility:
- Remove
#if LVGL_VERSION_MAJOR >= 8guards aroundfont_dscand the font struct - Remove the
.cachefield fromfont_dsc - Add
.release_glyph = NULL,.kerning = 0,.static_bitmap = 0to the font struct - Add
.fallback = NULL,.user_data = NULLto the font struct
Without these patches, fonts compile but render as invisible.
Licensing gray area warning
The software in this repository uses and adheres to the Anthropic brand guidelines and uses the same proprietary fonts that Anthropic has a licnese for but this software uses without permission as well as using assets from Anthropic such as the copyrighted Claude Code mascot head logo so even though the code in this repo is non-proprietary I will not license it myself under a copyleft license since this repo includes proprietary fonts and copyrighted assets. Please be aware of this if you fork or copy the code from this repo. You have been warned!
