Skip to content
leewsimpsonPublic

About

A desk dial for Claude Code: round AMOLED showing usage limits, context and session state, fed by a PC bridge over USB

Resources

Stars

1 star

Watchers

0 watching

Forks

Latest commit

 

History

26 Commits

Folders and files

Repository files navigation

claudesk

A desk dial for Claude Code. A small round AMOLED shows your usage limits, the context window of the chat you're in, and whether Claude is working, waiting for you, or asking you something.

claudesk on a desk: a lattice sphere with the round display showing usage rings and the project name
View full-size product image

  • Three rings, from the outside in: weekly allocation, 5-hour window, and context window. On the two usage rings, colour shows pace: green means you're on track to last until the reset, amber or red means you'll run out first. The context ring just turns amber, then red, as it fills.
  • Centre readout: the model, the project, and a big pixel-art desk pet whose mood follows the session (working, waiting, asking, dozing, asleep). Tap for a scrolling feed of what's happening (prompts, tool calls, subagents, errors).
  • States: active, idle, waiting (project name pulses amber), question (pulses red, faster) and offline. A short beep plays when a turn finishes, and a different one when Claude asks a question.
  • Press and hold the screen to see when the weekly and 5-hour limits reset.

The board never touches your credentials or the network. A small Python bridge on your PC reads Claude Code's local session transcripts, polls the usage endpoint, and streams JSON snapshots to the board over USB serial.

~/.claude/projects/*.jsonl ─┐
                            ├─► bridge (Python, PC) ──USB serial──► display (ESP32-S3)
api.anthropic.com usage ────┘

What's in the repo

Folder What it is
usage-display/ PlatformIO firmware for the board. PROTOCOL.md is the bridge-to-board wire format.
bridge/ The PC-side bridge (claude_usage_bridge.py, stdlib only), plus an optional Windows tray app (tray.py).
sim/ Desktop simulator. It compiles the firmware's main.cpp unmodified for Windows, so you can see the display without the hardware.
3d-model/ 3D-printable enclosure: a lattice sphere with a rear snap-fit cap. It includes ready-to-print STL/3MF files and the Fusion 360 build scripts.
scripts/ fetch-vendor.sh / .ps1 download the Waveshare libraries the firmware and simulator build against.
CLAUDE.md Hardware and rendering notes for the board, useful to humans and to Claude Code.

Hardware

  • Waveshare ESP32-S3-Touch-AMOLED-1.75: 466×466 round AMOLED, touch, and an ES8311 audio codec
  • Optional: the Waveshare 8Ω 2W 2030 cavity speaker (MX1.25 2-pin), for the beeps
  • Optional: the printed enclosure, plus a short 90° USB-C flat-ribbon pigtail (see 3d-model/CLAUDE.md for the exact part and how it's assembled)

Quick start

1. Get the vendor libraries

The firmware and simulator build against the library versions bundled in Waveshare's repo, pinned to a known-good commit. Fetch them once into vendor-repo/, which is gitignored:

bash scripts/fetch-vendor.sh        # or: ./scripts/fetch-vendor.ps1

2. Flash the board

You'll need PlatformIO (the CLI or the VS Code extension).

cd usage-display
pio run -t upload

No buttons needed: the upload reboots the running firmware into the bootloader itself. After the first flash, pio run -e ota -t upload is faster: it sends the firmware over the bridge's serial link. Either way, quit the tray/bridge first, because it holds the port. See usage-display/README.md.

3. Run the bridge

You'll need Python 3.9+ and Claude Code, signed in with a Claude subscription.

Find the board's serial port first. With the board plugged in, run pio device list and look for USB 303A:1001. On Windows it's a COMx port; on Linux it's usually /dev/ttyACM0.

cd bridge
pip install -r requirements.txt
python claude_usage_bridge.py --port COM5

Within a few seconds the board should leave its offline face and show your current session. If the board later comes back on a different port, the bridge finds it by its USB ID. If the board isn't plugged in yet, the bridge keeps retrying.

Useful flags:

  • --fake: synthetic data, nothing real is read. Use this to check the display works.
  • --no-usage: skip the usage API and show only session state
  • --session-mode priority|rotate|pinned: which chat to show when several are running. The default, priority, shows whichever chat needs you most.

Run python claude_usage_bridge.py --help for the full list. The bridge README explains how sessions are chosen.

4. Start it automatically

Windows: use the tray app. It runs the bridge in the background and shows a tray icon that turns into an error state if the bridge stops working.

pip install -r requirements-tray.txt
pythonw tray.py --port COM5

Right-click the tray icon and tick Start with Windows. This adds a shortcut to your Startup folder that relaunches the tray with the same flags each time you log in. If you move the repo or want different flags, untick it, relaunch the tray with the new flags, and tick it again. The same menu lets you switch session mode, pin a project, pause, or open the log.

macOS or Linux: there's no built-in autostart yet. The quickest way to set it up is to open Claude Code in this repo and paste:

Set up bridge/claude_usage_bridge.py to start automatically when I log in, using a launchd agent on macOS or a systemd user service on Linux. First find my board's serial port: it's the device with USB VID:PID 303A:1001. Run the bridge with --port <that port>, using absolute paths to this repo and to my python3, which must have pyserial installed. Restart it if it exits, and write its output to a log file. Then start it, and show me how to check that it's running and how to remove it.

No hardware? Use the simulator

The simulator showing the display

The simulator is Windows-only. You need the vendor libraries from step 1, Python, and MinGW-w64 g++ on your PATH (from MSYS2 or scoop install gcc, for example). Then, from the repo root, run:

bash usage-display/run-local.sh --fake      # or, in PowerShell 7: ./usage-display/run-local.ps1 --fake

It builds the simulator, starts the bridge, and opens a window showing the display. Drop --fake to see your real sessions.

How the usage data is read

The bridge reads your Claude Code OAuth token from ~/.claude/.credentials.json and calls the same usage endpoint the CLI uses for /usage, at most once per 5 minutes by default. That token never leaves your PC, and nothing is sent to the board except the numbers it displays. This is an unofficial endpoint, so it may change without notice. If it does, or you'd rather not call it, --no-usage keeps everything else working.

On macOS, Claude Code keeps the token in the Keychain rather than in that file, and the bridge doesn't read the Keychain yet. The weekly and 5-hour rings will stay empty there. The context ring and everything else still work.

Status

This is a personal project, built mostly with Claude Code. The firmware and bridge are in daily use. The enclosure is still being refined between prints. The simulator and the tray app are Windows-only. The bridge itself is plain Python and should also run on macOS and Linux, but that hasn't been tested.

License

MIT, except the enclosure models in 3d-model/exports/ and 3d-model/cad/, which are CC BY-NC-SA 4.0 (noncommercial use only).

Third-party material in this repo:

  • 3d-model/boardmodel/: board drawings published by Waveshare
  • 3d-model/scripts/strip_gapfill.py: from Nic Splattstoesser's homepod-mesh (PolyForm Noncommercial 1.0.0), which the enclosure's lattice is also based on. See 3d-model/README.md.
  • usage-display/include/fonts/: generated from Montserrat (SIL Open Font License)
  • usage-display/include/es8311*.h and src/es8311.c: Espressif's ES8311 driver (Apache-2.0), from Waveshare's examples

About

A desk dial for Claude Code: round AMOLED showing usage limits, context and session state, fed by a PC bridge over USB

Resources

Stars

1 star

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages