Help us shape the future of Go! Take the 2026 Go Developer Survey

clawmeter

module
v0.44.1 Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Oct 14, 2026 License: MIT

README

Clawmeter

Codex 5H tray icon Codex 7D tray icon Claude 7A tray icon Claude 7S tray icon

Clawmeter is a system tray and CLI quota meter for AI coding tools.

It answers the questions that matter while you are working: am I on track, what is most likely to run out, and when does it reset?

Install

macOS:

brew install tnunamak/clawmeter/clawmeter
brew services start clawmeter

Linux:

curl -fsSL https://raw.githubusercontent.com/tnunamak/clawmeter/main/install.sh | sh -s -- --start

Windows:

Download ClawmeterSetup.exe from the latest release, verify it with SHA256SUMS.txt, then run the installer. It creates a Start Menu tray shortcut, adds clawmeter to your user PATH, and includes an uninstall entry.

Windows artifacts are currently unsigned. The future signing path is documented in the Code signing policy and SignPath readiness checklist.

clawmeter providers

WinGet will install that same setup exe once the package is accepted:

winget install --id tnunamak.Clawmeter -e

Advanced/manual fallback: download clawmeter-windows-amd64.exe from the same release if you only want the portable binary.

.\clawmeter-windows-amd64.exe providers

You can also download .deb, .rpm, macOS, Linux, and Windows binaries from the latest release.

Then run:

clawmeter setup --all
clawmeter doctor

Setup installs the mainstream local surface Clawmeter can verify today: a Claude Code statusline. Every agent can also pull the same cheap quota summary with clawmeter status --agent.

Verify a download

Releases from v0.40.0 on sign SHA256SUMS.txt with minisign, and the self-updater refuses unsigned updates. To check a download yourself, see SECURITY.md.

Why Use It

  • See your riskiest quota without opening provider dashboards.
  • Compare current usage with expected pace for the reset window.
  • See reset credits and their earliest expiry under the matching provider source.
  • Cycle the tray icon between concrete provider/quota windows.
  • Reuse existing credentials. When required, Clawmeter refreshes short-lived access tokens against the provider's own OAuth service. Claude file-backed profiles save refreshed tokens to the exact Claude Code credential file they were read from; Kimi refreshes stay in memory. See Privacy Policy.
Claude Web Reset Grants

Claude's Usage page can show promotional reset grants that Claude Code's local usage data does not include. The Clawmeter Chrome extension (see Claude API Credits below) reads them each minute from an open claude.ai tab. claude.ai refuses requests that do not come from its own pages, so keep a claude.ai tab open; the extension also tries without one, but claude.ai usually refuses that.

The extension sends each organization's ID and grants (remaining count, start, expiry, and paused state) to Clawmeter on this computer. Clawmeter keeps only the organization a Claude source is signed in to, files the grants under that source, and stores a salted hash of the organization ID, never the ID itself. Only grants usable now count. Clawmeter stores no cookies or raw responses. If you later sign that source in to a different organization, the saved result is dropped.

The result shows under its Claude source as Resets: 1 · expires Oct 22. A reading more than five minutes old adds when it was read and open claude.ai in your browser.

Claude API Credits

Prepaid Claude API credits (for example the monthly API credit a Max plan grants) have no API for their balance or expiry, and Anthropic's Usage & Cost Admin API is unavailable to individual accounts. Clawmeter reads them from the Claude Console through the Clawmeter Chrome extension:

  1. Open the browser's Extensions page and enable Developer mode.
  2. Choose Load unpacked and select this repository's extension folder.
  3. Sign in to the Claude Console and claude.ai, keep a claude.ai tab open, and keep the browser and Clawmeter tray running.

The extension checks each minute. A reading is live for up to five minutes; older readings keep their numbers with a browser reminder, and signing out shows a sign-in reminder. Usage-cost reports used for the pace are cached for 30 minutes; readings that no longer reconcile with current spend are rejected.

When a Claude plan funds the organization (the Console links it to that plan's claude.ai organization), the pool shows on the Claude source signed in to that plan:

Claude · Default: 5h: 1% … · API credits: $199.88 left · spent $0.11 this month · on pace to spend $1.84 more before it expires Oct 24 19:00

Other Console organizations show as their own pools under Claude API. Clawmeter stores the plan link as a salted hash of the plan's organization ID, as for reset grants, and the pool moves back under Claude API if that source signs in elsewhere.

The balance is what the Console's billing page shows: purchased plus promotional credit. Spend this month is the Console's own total. The pace is the average daily cost from the Console's cost report over up to 7 days (at least one day), and the projection extends it to the next credit expiry, or to when the balance runs out first. Expiry shows in local time; the Console shows UTC dates. The extension refuses to send data when the Console's daily costs and its month total disagree. clawmeter status --agent lists every pool under api_credits=[...] with exact amounts so agents can budget API spend.

The extension sends a hash of the Console organization ID, never the ID. It sends the linked plan organization ID only to the local receiver, which hashes it before saving. Clawmeter stores no cookies or raw organization IDs.

Read The Icon

The provider logo stays in the circular center chip. The text names the quota window: 5H, 7D, 7A, 7S, or MO.

The radial meter compares actual burn with expected pace. Gray shows the shared baseline; a solid green segment means you are under pace, and a solid red segment means you are over pace.

  • Left-click the tray icon to cycle through active provider/quota windows.
  • Double-click the tray icon to return to Auto.
  • Auto picks a quota window and is not part of the left-click cycle.
  • The tray menu's Settings can switch Auto between Risk, EST, and Runway:
    • Risk: the quota projected to block you soonest.
    • EST: the highest projected-at-reset percentage.
    • Runway: the quota with the most projected room left.
  • Right-click for details, refresh, and update. Click a provider's name to open its dashboard. Settings holds the icon options and launch-at-login.
  • A small blue dot on the tray icon means an update is available.
  • Use Refresh Now when you want an immediate quota/update check.

CLI

clawmeter
PROVIDER   WINDOW    USAGE                 PCT  resets IN      PACE
Claude     5h        ██░░░░░░░░░░░░░░░░░░  11%  resets 4h00m   est. 55% at reset
           7d All    ██████████████████░░  89%  resets 1d10h   est. 112% at reset · runs out in 16h
           7d Sonnet ░░░░░░░░░░░░░░░░░░░░   2%  resets 4d23h   est. 7% at reset

Useful commands:

clawmeter providers      # detected providers and auth status
clawmeter providers diagnose codex --pretty  # privacy-safe live diagnostic
clawmeter providers diagnose claude --raw     # raw provider response per source (redacted), to verify a reading
clawmeter providers source list               # enrolled source ids and labels
clawmeter providers source add <provider> <id> <kind> [ref] [--label <label>]
clawmeter providers source remove claude work # final removal also disables the provider
clawmeter claude         # one provider
clawmeter codex          # Codex quota
clawmeter grok           # Grok quota
clawmeter --json         # machine-readable output
clawmeter statusline     # compact Claude/statusline segment

Restart a running tray after changing sources to apply the change.

Source enrollment uses provider-declared kinds. Run clawmeter providers source help <provider> to see the exact routes that provider supports. native takes no ref; file and directory routes require absolute paths; environment routes take the variable name, never its secret value. Unsupported kinds fail before configuration is saved.

When the currently detected native source exists, adding the first named source keeps it as Default. Otherwise Clawmeter adds only the named source, avoiding a broken empty row. Every named source uses only its enrolled credential route. Clawmeter does not scan for additional accounts or combine quotas across sources.

clawmeter providers source help codex
clawmeter providers source add codex work codex-home ~/.codex-work --label Work
clawmeter status --agent # token-efficient all-quota summary for AI agents
clawmeter setup --all    # install mainstream local integrations
clawmeter doctor         # provider and integration readiness
clawmeter --check        # monitoring exit code
clawmeter update         # self-update
clawmeter tray           # run the tray in this session

Providers

Provider Tracks
Claude 5h, 7d, model-specific windows
Codex 5h and weekly rate limits; banked reset-credit expiry when available
Antigravity Separate weekly pools for Gemini models and Claude/GPT models
Gemini 24h Pro-model and Flash-model quotas; Code Assist tier checked when available
GitHub Copilot Provider-reported premium, chat, and completion quotas when available
Grok/xAI Grok weekly usage pool; API prepaid credits
Kimi Usage and rate limits; cadence is provider-reported/experimental
OpenRouter Wallet credit balance and finite API-key limits
JetBrains AI Monthly credits
Kimi K2 Credit balance
Alibaba Coding Plan Coding Plan 5-hour, weekly, and monthly quotas
Alibaba Token Plan Personal Token Plan 5-hour, 7-day, and reset-credit data after one-time Model Studio quota connection
DeepSeek Account balance only (read-only); no utilization, spend, or reset-time data

Unavailable providers stay hidden by default. Use clawmeter --all to see everything Clawmeter checked.

Model selection and quota windows are separate. Claude's model-scoped weekly windows use the names returned by Anthropic, including new model names. Codex's quota response does not identify the active model, so Codex rows stay labeled by the provider and the reported time window rather than guessing from the CLI model selection.

Provider maturity is binary and intentionally kept out of quota rows and the tray. The clawmeter providers inventory and --json metadata identify experimental integrations and link to provider maturity.

Automation should use the versioned --json machine interface, not parse terminal output. Its schemas, compatibility policy, diagnostic command, and consumer guidance are published with the repository.

Codex reset-credit visibility is read-only. Clawmeter shows available count and earliest expiry when Codex exposes banked resets locally, but it never redeems resets. Design notes and provider coverage are in Reset awareness.

Details

Agent integrations
clawmeter setup --all
clawmeter setup --claude-statusline
clawmeter setup --dry-run --all
clawmeter doctor

clawmeter statusline is cache-only, so Claude Code can call it frequently without refreshing provider APIs or burning quota. clawmeter status --agent is the high-precision pull command for Codex, Claude, Gemini CLI, or any other agent when quota context is useful.

tmux users can opt in explicitly:

clawmeter setup --tmux
Install options

Linux installer defaults to a user install: binary in ~/.local/bin, app launcher entry, no tray start, no launch-at-login, and no system package install. Pass --start to launch the tray now, or --autostart to enable launch-at-login.

curl -fsSL https://raw.githubusercontent.com/tnunamak/clawmeter/main/install.sh | sh -s -- --dry-run
curl -fsSL https://raw.githubusercontent.com/tnunamak/clawmeter/main/install.sh | sh -s -- --start --autostart
curl -fsSL https://raw.githubusercontent.com/tnunamak/clawmeter/main/install.sh | sh -s -- --uninstall

Windows users should prefer ClawmeterSetup.exe. WinGet is the package-manager path after acceptance. clawmeter-windows-amd64.exe is the portable fallback. install.ps1 remains an advanced scripting fallback with -LocalBinary, -Start, -Startup, and -Uninstall; if you use it directly, download the script first and run it from a folder you trust. Avoid copy-pasting download-and-execute one-liners.

macOS Homebrew installs a local app wrapper. To show it in Applications/Launchpad:

mkdir -p ~/Applications
ln -sfn "$(brew --prefix clawmeter)/Clawmeter.app" ~/Applications/Clawmeter.app
Configuration

Config file: ~/.config/clawmeter/config.yaml

clawmeter config show
clawmeter codex
clawmeter grok
clawmeter providers enable openrouter
clawmeter config disable copilot
clawmeter config set poll_interval 600
clawmeter config set warning_threshold 80
clawmeter config set critical_threshold 95
Launch at login
clawmeter tray --install
clawmeter tray --uninstall

clawmeter tray starts the tray for the current desktop session. For a persistent desktop tray, use the installer/Start Menu shortcut or clawmeter tray --install.

On macOS with Homebrew, you can also use:

brew services start clawmeter
brew services stop clawmeter
Provider credential sources
Provider Source
Claude Claude Code OAuth token
Codex ~/.codex/auth.json
Antigravity ~/.gemini/antigravity-cli/antigravity-oauth-token from agy login
Gemini ~/.gemini/ OAuth credentials
GitHub Copilot ~/.config/github-copilot/hosts.json
Grok/xAI ~/.grok/auth.json from grok login; or XAI_MANAGEMENT_API_KEY with optional XAI_TEAM_ID
Kimi ~/.kimi/credentials/kimi-code.json
OpenRouter OPENROUTER_API_KEY or config; optional OPENROUTER_MANAGEMENT_KEY for wallet credits
JetBrains AI IDE config files
Kimi K2 KIMI_K2_API_KEY or config
Alibaba Coding Plan Dedicated Model Studio console login (bl auth login --console) or ALIBABA_CODING_PLAN_API_KEY / BAILIAN_CODING_PLAN_API_KEY (Coding Plan key only)
Alibaba Token Plan One-time Model Studio quota connection via clawmeter providers connect token-plan; existing ~/.bailian session is reused
DeepSeek DEEPSEEK_API_KEY or config

For Grok/xAI, grok login enables Grok weekly usage-pool tracking from the read-only grok.com billing surface. XAI_MANAGEMENT_API_KEY enables xAI API prepaid-credit tracking from the Management API; use a Management API key from xAI Console settings, not the model-serving XAI_API_KEY. Clawmeter does not create, rotate, delete, top up, or spend anything.

For Alibaba Coding Plan, Clawmeter reads the official Model Studio CLI's console-login session from its dedicated Coding Plan profile or ~/.bailian. It sends only the read-only quota query, never reads browser cookies and never calls a model or plan-management endpoint. Personal Token Plan remains a separate provider and session profile.

For Alibaba Token Plan, run clawmeter providers connect token-plan once to authorize the official Model Studio console session. Clawmeter then reads only the read-only quota and reset-card operations. BAILIAN_TOKEN_PLAN_API_KEY continues to be useful for model requests, but it does not provide account-level Token Plan quota and is never treated as quota authorization. If the official Bailian CLI is missing, Clawmeter prints Alibaba's documented install command; it does not silently download executable code.

DeepSeek is read-only balance semantics. Clawmeter calls only the documented GET /user/balance endpoint and reports the account balance per currency; it never exposes utilization percentage, spend, quota totals, or reset timing, because DeepSeek's balance API does not provide them. Clawmeter never tops up, spends, or rotates the key.

Build from source
git clone https://github.com/tnunamak/clawmeter.git
cd clawmeter
make install          # CLI only
make install-tray     # with system tray support

Tray builds require CGO. Linux also needs libayatana-appindicator3-dev.

How It Works

Clawmeter reads existing credentials from your AI coding tools and queries their usage APIs. Results are cached at ~/.cache/clawmeter/usage.json for 60 seconds, so the CLI and tray do not hammer provider APIs. See Privacy Policy, Security Policy, and Third-party components.

Directories

Path Synopsis
cmd
clawmeter command
icon-sheet command
icon-sheet renders the current tray icon system for visual review.
icon-sheet renders the current tray icon system for visual review.
internal
autostart
Package autostart manages launch-at-login for the clawmeter tray on Linux (XDG .desktop), macOS (LaunchAgent), and Windows (registry Run key).
Package autostart manages launch-at-login for the clawmeter tray on Linux (XDG .desktop), macOS (LaunchAgent), and Windows (registry Run key).
cache
Package cache provides caching for provider usage data.
Package cache provides caching for provider usage data.
cli
config
Package config handles configuration for multiple providers.
Package config handles configuration for multiple providers.
diagnose
Package diagnose builds privacy-safe provider diagnostics.
Package diagnose builds privacy-safe provider diagnostics.
format
Package format provides shared formatting utilities.
Package format provides shared formatting utilities.
provider
Package provider defines the interface and types for AI service providers.
Package provider defines the interface and types for AI service providers.
provider/alibaba
Package alibaba implements the Provider interface for Alibaba Cloud Model Studio Coding Plan quotas (Qwen / DashScope).
Package alibaba implements the Provider interface for Alibaba Cloud Model Studio Coding Plan quotas (Qwen / DashScope).
provider/alibabatoken
Package alibabatoken reads Alibaba Personal Token Plan usage through a read-only Model Studio console session.
Package alibabatoken reads Alibaba Personal Token Plan usage through a read-only Model Studio console session.
provider/all
Package all registers every known provider with a registry.
Package all registers every known provider with a registry.
provider/anthropic
Package anthropic implements the Provider interface for Anthropic/Claude.
Package anthropic implements the Provider interface for Anthropic/Claude.
provider/antigravity
Package antigravity implements quota monitoring for the Antigravity CLI.
Package antigravity implements quota monitoring for the Antigravity CLI.
provider/claudeapi
Package claudeapi shows prepaid Claude API credit pools saved by the Clawmeter browser extension.
Package claudeapi shows prepaid Claude API credit pools saved by the Clawmeter browser extension.
provider/claudeweb
Package claudeweb exposes browser-observed Claude reset credits as a hidden supplemental source.
Package claudeweb exposes browser-observed Claude reset credits as a hidden supplemental source.
provider/copilot
Package copilot implements the Provider interface for GitHub Copilot.
Package copilot implements the Provider interface for GitHub Copilot.
provider/deepseek
Package deepseek implements DeepSeek's read-only account balance endpoint.
Package deepseek implements DeepSeek's read-only account balance endpoint.
provider/gemini
Package gemini implements the Provider interface for Google Gemini.
Package gemini implements the Provider interface for Google Gemini.
provider/jetbrains
Package jetbrains implements the Provider interface for JetBrains AI Assistant.
Package jetbrains implements the Provider interface for JetBrains AI Assistant.
provider/kimi
Package kimi implements the Provider interface for Kimi Code CLI.
Package kimi implements the Provider interface for Kimi Code CLI.
provider/kimik2
Package kimik2 implements the Provider interface for Kimi K2.
Package kimik2 implements the Provider interface for Kimi K2.
provider/oauth
Package oauth provides reusable OAuth token refresh utilities.
Package oauth provides reusable OAuth token refresh utilities.
provider/openai
Package openai implements the Provider interface for Codex via JSON-RPC subprocess.
Package openai implements the Provider interface for Codex via JSON-RPC subprocess.
provider/openrouter
Package openrouter implements the Provider interface for OpenRouter.
Package openrouter implements the Provider interface for OpenRouter.
provider/synthetic
Package synthetic implements the Provider interface for Synthetic (synthetic.new).
Package synthetic implements the Provider interface for Synthetic (synthetic.new).
provider/xai
Package xai implements the Provider interface for xAI/Grok usage.
Package xai implements the Provider interface for xAI/Grok usage.
provider/zai
Package zai implements the Provider interface for z.ai (Zhipu AI / GLM).
Package zai implements the Provider interface for z.ai (Zhipu AI / GLM).
shellpath
Package shellpath ensures the tray process sees the user's full PATH, not the stale snapshot it inherits from its launcher.
Package shellpath ensures the tray process sees the user's full PATH, not the stale snapshot it inherits from its launcher.
status
Package status fetches provider operational status from status pages.
Package status fetches provider operational status from status pages.
systray
Package systray is a cross-platform Go library to place an icon and menu in the notification area.
Package systray is a cross-platform Go library to place an icon and menu in the notification area.
systray/internal/generated/menu
Code generated by dbus-codegen-go DO NOT EDIT.
Code generated by dbus-codegen-go DO NOT EDIT.
systray/internal/generated/notifier
Code generated by dbus-codegen-go DO NOT EDIT.
Code generated by dbus-codegen-go DO NOT EDIT.
tools
sign-release command
Command sign-release signs and verifies a release's SHA256SUMS.txt with minisign.
Command sign-release signs and verifies a release's SHA256SUMS.txt with minisign.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL