r/ClaudeCode • • 3d ago

Built with Claude I built a 1.6 MB native always-on-top usage widget for Windows and macOS with Claude Code

What it is

A small floating widget that keeps your 5-hour session and weekly usage (with reset countdowns) on screen, so I stopped interrupting long sessions to type /usage.

Why another one? I know there are several usage trackers already. Most are tray or menu-bar icons. The floating widget I found that runs on both Windows and macOS is a ~100 MB Electron app, and many tools reuse Claude Code's own credentials. I wanted something tiny, native and always visible that doesn't touch the Claude Code login. It deliberately has fewer features: no history graph, notifications or multiple accounts.

How Claude Code was used

- Design first: Claude Code wrote a spec and an implementation plan, and I approved each before any code was written.

- Built task by task, writing tests first. The core (parsing, fetching, state, menu, layout) is shared between both apps and fully unit-tested.

- I don't own a Mac. The whole macOS version (Rust and AppKit) was built and checked on GitHub Actions: CI launches the app, takes screenshots, checks quit time and runs a 10-minute memory-leak test.

- At the end, a fresh Claude instance reviewed the whole branch, and its findings were fixed with a test for each.

What I learned (real bugs)

- macOS sign-in stayed blank. Shown in a blocking (modal) window, the login page never loaded, because WebKit needs the normal event loop. It became a normal window, and it loads in about 4 s.

- Windows widget vanished behind a maximized terminal. It was still flagged always-on-top, but another app had pushed it down. It now checks once a second and restores itself, doing nothing when it isn't needed.

- Rules I gave Claude Code from day one: never reuse Claude Code's OAuth credentials, never get around bot protection, an honest User-Agent, read-only access, never log the session key. Writing these down up front kept the project from sliding into grey areas.

- Quit and sign-out used to wait up to 15 s on a stalled network request. The final review caught it, and they're instant now.

Caveats

- Unofficial: it uses claude.ai's internal usage endpoint, so it may break.

- macOS sign-in hasn't been confirmed on a real Mac yet. Reports welcome.

- Not code-signed, so SmartScreen and Gatekeeper ask once.

Repo (GPL-3.0): https://github.com/cagaozer/claude-usage-widget-mini
Happy to answer questions about the process.

0 Upvotes

1 comment sorted by

•

u/AutoModerator 3d ago

Hey! Thanks for posting to r/ClaudeCode

While participating in this thread, please follow our community rules. Keep discussions constructive. Attack the idea, not the person.

For help, project discussions, tips, and general chat, join the ClaudeCode Discord.

I am a bot, and this action was performed automatically. Please contact the moderators of this subreddit if you have any questions or concerns.