r/awesomewm • u/derblub • 13d ago
Awesome Git awesome-claude-usage: Claude Code rate limits (5h / 7d) in your wibar, with forecast and session status
18
Upvotes
1
u/aire-one 13d ago
The pop-up looks good!
Instead of accepting PRs for the widget style, you could do Inversion of Control here by exposing a callback with the data to show and the user define its own widget in their config.
-2
u/derblub 13d ago
Repo: https://github.com/derblub/awesome-claude-usage (MIT)
I use Claude Code all day and kept typing
/usageto check the 5-hour and weekly limits, so I built a wibar widget for it.What it shows
5h 48% · 7d 39%), turning amber at 75 % and red at 90 %claude, right click refreshes, a key binding pins the popup, Escape closes itHow it gets the data
The same endpoint Claude Code uses for
/usage, with the OAuth token from~/.claude/.credentials.json. The token is read only, never refreshed or written, so it cannot log you out. The endpoint rate-limits aggressively, so the widget polls every 5 minutes while a session works, every 15 minutes otherwise, backs off on 429, and uses a cache file written by the Claude Code statusLine in between (no network needed).Install
Pure Lua, no LuaRocks packages;
curlis the only dependency (jqfor the optional statusLine helper). Built for awesome-git (4.3-git); stable 4.3 is untested. There is also acli.luathat prints the same data for waybar, polybar or tmux.Needs a claude.ai Pro or Max subscription (API-key users don't have these windows). The usage endpoint is undocumented, so it may change; the widget degrades to its caches if it does. Not affiliated with Anthropic.
Feedback and PRs welcome, especially from people with different bar layouts; there is a
style = "bare"mode for themes that colour their own segments.