All projects
● Complete

Multi-account support for Claude Usage Widget

Slavomir Durej and Damon Downing’s widget. 13 of its 252 commits are mine.

Contributor · May 2026 – Jun 2026

The widget is Slavomir Durej and Damon Downing’s, and it held one session key at a time. I run two Claude accounts, so the fork got an account store: keys encrypted through Electron safeStorage, a panel that polls every saved account, and a one-time migration of an existing single-account install. The UI was the easy half. Switching accounts swaps the cookie inside one shared Electron session, so two overlapping fetches can label one account’s numbers with another account’s name.

13 of 252
Commits on the fork branch that are mine. 220 are Damon Downing’s, 12 Slavomir Durej’s.
9
Commits in the merged multi-account pull request (#2)
2,442
Lines added across my 13 commits
28 → 33
Electron majors, bumped to get the backgroundMaterial API the flyout needs

Whose project this is

Slavomir Durej wrote the original Claude Usage Widget. Damon Downing has done the great majority of the work since: of the 252 commits on the branch I work from, 220 are his across three git identities, 12 are Durej's, and 7 belong to four other contributors. Mine are the remaining 13. The usage API client, the rendering, the Chart.js history graph, the settings system, the threshold alerts, the packaging and the release process are all upstream work, MIT licensed, at github.com/SlavomirDurej/claude-usage-widget. What I added sits on top of that as three separate features. The multi-account branch was merged into my fork, not into upstream.

Multi-account

The widget stored one session key, and I wanted two accounts visible side by side. The fork got an account store with add, rename, delete and switch from the settings panel, session keys encrypted through Electron's safeStorage with a plaintext fallback for machines where the OS keychain is unavailable, and a panel that shows session and weekly bars for every saved account on the normal poll interval. Existing single-account installs migrate into the store on first launch. The risk is the shared session. Reading another account's usage means swapping the cookie inside one Electron session object, so two overlapping fetches can return one account's numbers under another account's label. That path runs behind an in-flight mutex, and the previous session is restored in a finally block whether the fetch returned or threw. Account labels are user-supplied, so they reach the DOM through textContent, and the IPC handlers validate id format, label length and the organization UUID before any URL is built. Nine commits, merged through pull request #2. Neither the fork nor upstream has an automated test suite, so I verified the feature with a PowerShell script that attaches to the running Electron renderer over the Chrome DevTools Protocol and walks five states: baseline, settings panel, an account switch, the all-accounts panel, and a refresh.

The skin and the tray flyout

Two smaller additions. A "Liquid" skin gives the frameless window see-through translucency with a three-step transparency control, dark and light variants, and the usage colors left untouched so session, weekly, warning and danger states stay readable through the glass. The fidelity limit went into the commit message rather than being papered over: CSS backdrop-filter cannot sample the desktop behind a transparent window, and Windows Acrylic flattens when the window loses focus and will not combine with a transparent Electron window at all. So the skin uses unblurred translucency, and the transparency control exists to trade clarity against legibility. The other is a Windows 11 tray flyout — a second small window with a Mica backdrop that slides up from the tray icon, shows the two usage bars, and dismisses on blur. Mica arrives through Electron's backgroundMaterial option, which meant taking the app from Electron 28 to 33 and checking the rest of it against the upgrade before the flyout could land.

Built with

Electron 33JavaScriptNode.jsChart.jselectron-storeWindows MicaCSSChrome DevTools ProtocolPowerShell