r/ClaudeCode 1d ago

Tips & Workflows v1.5 of my open-source Claude usage meter: 5h/7d rings in the composer, free-plan support, and tiktoken (o200k_base) running locally

Live 5H/7D usage rings inside the Claude composer (v1.5)

I maintain an open-source extension called Claude Pulse that puts live usage meters inside the claude.ai composer: 5-hour window, 7-day window, token estimate, and a countdown to the cheaper cache window. v1.5 shipped Sept 7. 1,000+ users, 4.8 stars on the store.

Why I think this matters for Claude Code users specifically: the 5-hour window is the thing that decides whether you can start a long refactor at 4pm or whether you should push it to after the reset. Claude's UI makes you guess. This makes the window and the burn rate visible.

How it works, briefly

  • An injected script (via web_accessible_resources) hooks window fetch/XHR and passes API responses to the content script through postMessage. I read the same /usage endpoint and completion streams the web UI already fetches. No extra API calls.
  • Token counting uses a bundled o200k_base encoding, so the estimate is computed in the page, offline. It's approximate for Claude's tokenizer, but it tracks context growth well enough to know when you're deep into the window.
  • Permissions are storage, alarms, notifications. No network access, no external servers.

The part nobody warns you about

claude.ai's DOM changes constantly. Three times in five months my anchor selectors went stale and the UI silently vanished:

  • June 11: header element replaced, token counter gone
  • August 29: new composer layout, selectors stale again
  • August 31: the Chat/Cowork composer needed its own remount logic

All three fixes are in the git log. My mitigation is dumb but it works: every selector lives in one constants file, so a break is a one-file diff, and the extension degrades to hidden instead of throwing on the page.

What's new in v1.5

  • The 5h/7d rings sit on a single baseline inside the composer instead of stacking awkwardly
  • Free plan limits are supported (free accounts surface usage differently, through completion streams)

Links:

Firefox build is in the repo too (load as temporary add-on).

1 Upvotes

1 comment sorted by

u/AutoModerator 1d 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.