Repository navigation
Description
Plugin version
2.2.1
Area
DankBar widget
Environment
DMS: dms v2.0.0 (dms-2.0.0-1.1)
Quickshell: 0.3.2 (quickshell-0.3.2-1.24, danklinux repo)
Qt: 6.12.0 (libQt6Qml6-6.12.0-2.1)
Compositor: Hyprland 0.57.0 (Lua config)
Distro: openSUSE Tumbleweed 20261030
Kernel: 7.3.0-1-default
bash: 5.3.20
jq: 1.8.2
curl: 8.23.0
Plugin: aiOverviewControl 2.2.1
Steps to reproduce
just using the widget and claude on cli
Expected behavior
The Session percentage displayed by the widget should reflect the current usage shown in Claude's web interface/account status.
Actual behavior
The Session metric does not match the actual remaining or consumed limit on Claude. It feels like the parsing or tracking logic for the session window might have broken recently (possibly due to an upstream change by Anthropic or something introduced in the latest release).
The weekly metric seems less affected (or at least the deviation is much more noticeable on the Session counter). Has anyone else reported discrepancies with Claude's session tracking on v2.2.1, or could an endpoint/HTML structure change on Claude's end have caused this?
I've tried to reload many times (no errors or something), remove the widget from the bar and adding it again. Same results
Local checks
$ jq . plugin.json >/dev/null && echo ok
ok
$ bash -n providers/get-provider-usage providers/get-copilot-usage providers/get-claude-usage && echo ok
ok
$ ./providers/get-provider-usage "codex,claude,copilot,openrouter" | jq -c '.[] | {provider, source, error, primary: .usage.primary.usedPercent}'
{"provider":"codex","source":"codex-app-server","error":{"code":127,"kind":"runtime","message":"Codex CLI is not installed or is not available in PATH."},"primary":null}
{"provider":"claude","source":"claude-local","error":null,"primary":0}
{"provider":"copilot","source":"github-copilot-api","error":null,"primary":100}
{"provider":"openrouter","source":"openrouter-api","error":{"code":2,"kind":"provider","message":"OPENROUTER_API_KEY is not set and no local 9Router usage was found."},"primary":null}
$ ./providers/get-copilot-usage | jq -c '{provider, source, error, login: .usage.loginMethod}'
{"provider":"copilot","source":"github-copilot-api","error":null,"login":"github-token"}
Activity
guidi-injenia commentedon Nov 4, 2026
Found the cause: the parsing is fine. The widget is showing stale cached data.
api.anthropic.com/api/oauth/usagewas returning HTTP 429 (rate limited). On a 429,get-claude-usagesilently falls back to the last cached snapshot, even when it is hours old. Mine was from 08:28 UTC, and its 5-hour window had already reset at 09:00. That's why Session showed 0% while claude.ai showed 16%.The rate limit was triggered by too many pollers on the same account: this widget (loaded twice), another quota plugin polling every 60 s, and Claude Code itself. I raised
refreshIntervalto 300 s and disabled the other plugin.Suggestions:
Note: the widget is instantiated once per monitor (bar on "all" screens), each with its own timer. The 120 s cache normally dedupes them, but after a 429 the cache is never refreshed, so every instance re-hits the API on every tick, multiplying requests while already rate-limited.
bernardopg commentedon Nov 5, 2026
Thank you @guidi-injenia, both for the report and for the follow-up diagnosis. Tracing it to the 429 fallback, and noticing that the widget is instantiated once per monitor with its own timer, was exactly what was needed: you had already found the root cause.
You're right on every point. 2.2.2 (#89) made the fallback snapshot keep its real fetch time, so the card turned Stale, but the adapter still asked again on every tick of every instance, and the bar kept showing the old numbers at full colour.
#97 implements all three of your suggestions:
Retry-After(capped at one hour). The backoff is stored in the account cache under the lock every run already takes, so all widget instances (one per monitor) and the credits request share it. The last good snapshot is served meanwhile. A manual refresh honours the backoff too, since asking again would only extend the limit.Rate limited · next try HH:MM, and the bar tooltip addsstale since HH:MM:SSplus the next try.The troubleshooting docs also cover what you found: the limit is per account and shared with Claude Code and any other poller, so raising Refresh interval and stopping duplicate pollers is the fix when the backoff keeps coming back. Your fix will be credited in the changelog.
It will ship in the next release. I'll update this issue when it's out.
bernardopg commentedon Nov 5, 2026
The backoff, the next-try notice on the card and the faded stale pill are out in v2.2.4. Update through Settings → Plugins → Check for updates; no restart is needed. Thanks again @guidi-injenia!
fix(claude): back off a rate-limited usage endpoint and fade stale pills
feat(claude): read usage from the Claude Code status line