Claude Code and Kimi Code plan usage in the GNOME top bar.
- Plan usage from the provider. How much of each quota window is used, read from the provider's own API, never estimated: Claude Code's 5-hour and weekly windows, Kimi Code's 5-hour window and plan. Bars turn amber at 75% and red at 90%.
- Tokens and requests today and over the last 7 days, counted from the local session logs, which keep working when a quota endpoint does not. The terminal view also splits today by model.
- Says how old the figures are. Each agent shows when its quota was last fetched, and a reading that could not be refreshed is marked as last known.
- A terminal view,
agent-usage, with the same reading on any desktop.
- GNOME Shell 48, 49 or 50 for the panel indicator. The shell will not load an
extension whose
metadata.jsondoes not list its version. - Python 3.8 or newer, standard library only.
- A systemd user session to run the collector. Without one, run
agent-usage --daemonyourself. - Claude Code or Kimi Code, signed in with a subscription. An API-key sign-in gives token counts but no quota bars, because the quota is per plan.
There is no key to paste: the collector uses the token each tool saved when you signed in. A tool that is not installed is not shown.
git clone https://github.com/pgiahuy/agent-usage.git && cd agent-usage
./install.shLog out and back in once. GNOME Shell only picks up a new extension at login.
Everything goes under your home directory:
| Path | Contents |
|---|---|
~/.local/share/agent-usage/ |
the collector |
~/.local/bin/agent-usage |
the command |
~/.local/share/gnome-shell/extensions/agent-usage@pgiahuy.github.io/ |
the extension |
~/.config/systemd/user/agent-usage.service |
the service |
~/.cache/agent-usage/ |
readings and ring icons |
To upgrade, run ./install.sh again. It reloads the indicator without a
logout, except when extension.js or metadata.json changed or the previous
install had no preferences page; it says so when that happens.
For a system-wide .deb or an APT repository, see
docs/packaging.md.
Click the indicator for the popup. Refresh fetches the quota now rather than at the next check, unless the last reading is under 30 seconds old or the provider is rate-limiting, and renews a token that has expired.
The settings are under Agent Usage in the Extensions app: how often to check quota (2 to 60 minutes, default 5), which agents to show, the popup layout (tiles, compact or large numbers) and the panel style (ring or text).
From a terminal:
agent-usage # the reading
agent-usage --json # the reading as JSON
agent-usage --daemon # the collector, in the foregroundIf Claude Code or Kimi Code keeps its data elsewhere, set CLAUDE_CONFIG_DIR
or KIMI_CODE_HOME in ~/.config/environment.d/agent-usage.conf, since a
systemd user service does not read your shell profile:
CLAUDE_CONFIG_DIR=/data/claude
KIMI_CODE_HOME=/data/kimi-code
Then log out and back in, or run
systemctl --user daemon-reload && systemctl --user restart agent-usage.
Run the read-only check first. It names the problem and the command to fix it.
./tools/doctor.sh- Nothing in the panel. Usually one of: the session was not restarted
after the install; user extensions are switched off
(
gsettings get org.gnome.shell disable-user-extensionsprintstrue); or GNOME Shell is newer thanextension/metadata.jsonlists. - "agent-usage daemon is not running". Check
systemctl --user status agent-usageandjournalctl --user -u agent-usage -n 50. - "rate limited, retrying in ...". The provider limits how often its usage endpoint is asked. The collector backs off on its own and keeps the last reading on screen.
- Kimi shows "token expired". Press Refresh. If it then says
"kimi is running", the token renews the next time that
kimisession talks to Kimi.
./uninstall.sh # keeps the cache and the settings
./uninstall.sh --purge # also deletes ~/.cache/agent-usage and resets the settingsThe indicator leaves the panel at once, or at the next login if GNOME Shell cannot unload it.
The collector talks only to the providers, with your own credentials: quota
checks to api.anthropic.com and api.kimi.com, and on Refresh, a token
renewal. There is no telemetry. SECURITY.md lists what it reads,
sends and writes, and how to report a vulnerability.
Issues and pull requests are welcome: see CONTRIBUTING.md and docs/hacking.md. Participation is covered by the code of conduct. Changes are listed in CHANGELOG.md.
