weektoken

Reviewed at commit 13c2ab1

Pace for the 5-hour, 7-day and per-model weekly limits such as Fable, shown as usage against elapsed time above the prompt, plus a /weektoken pane with a…

Made by
mj0111
What we checked

Shows a band above the prompt and a /weektoken pane with how fast you are using your 5-hour and weekly limits compared with elapsed time. It reads the usage figures from your session and from Claude Code's local usage cache, and now also asks Anthropic's own usage endpoint every 15 minutes (before, only on manual refresh) or runs claude /usage. It stores only usage percentages and your display choices.

Review details

Static review of the source at the pinned commit; not run. Delta review of the changes since 9f0bf8e; the rest carries over from the review at that commit. Changes: a new autoUsage timer (every 15 minutes and 20 seconds after session start) calls the same https://api.anthropic.com/api/oauth/usage endpoint through $.http.fetch with the host-supplied auth handle (the mod never sees the credential); sessions share the schedule through the store and a failure backs off for an hour. The endpoint's quota list is stored so quotas the plan no longer has are hidden. The sample history is no longer capped at 8000 entries but thinned by age (compactSamples/fitSamples) to about 1.5 MB, and the optional ~/.weektoken/samples.jsonl import now reads the whole file once with tail -n 1000000, then the last 2000 lines (fixed argv, no shell). The burn-up page also reports gaps in readings. Registers session.start, turn.complete, session.measure, command.run (/weektoken, show/hide), ui.press, ui.focus, config.set (language), ui.close and ui.render for AbovePrompt and Pane. Reads ~/.claude.json with $.fs.read (falling back to a fixed perl one-liner extracting only the cachedUsageUtilization section) and parses only that key. Manual refresh falls back to running claude -p --no-session-persistence /usage with a fixed argument list. Also runs defaults read -g AppleLanguages and reads LANG/PATH style environment variables. Reads its own plugin.json for the version. No shell, no eval, no remote code; SVG is generated locally. CLAUDE_MODS_DISABLE turns it off. Failures are swallowed.

What it uses
  • Reads your prompts: no
  • Sees tool calls: no
  • Blocks or changes tool calls: no
  • Reads or writes files: yes
  • Runs programs on your machine: yes
  • Calls the model (uses tokens): no
  • Sends data over the network: yes
  • Stores data: yes
  • Shows something on screen: yes
Hooked events
Screenshot of weektoken

Rate-limit pace for Claude Code's 5-hour and weekly windows: usage against elapsed time, plain-language forecast, per-model quotas and burn-up history. A band above the prompt and a full /weektoken pane, in English or Chinese.

Made this mod? Add a badge to your README

modsforClaude badge for weektoken

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/weektoken.svg)](https://modsforclaude.com/mods/weektoken/)

← All mods