Skip to main content

A Claude Code token-usage meter for the Windows taskbar

Project description

English · Español

Claude Code Meter

A Claude Code token-usage meter for Windows. It reads Claude Code's local session logs and shows how much you've spent today / this week / this month, compared against a target you set yourself.

Claude Code Meter embedded in the Windows taskbar

The figures (Day · Week · Month) live inside the taskbar, next to the clock. Each percentage is colored by level: 🟢 < 70 % · 🟡 < 90 % · 🔴 ≥ 90 %. On a Spanish Windows the labels show as D · S · M (Día/Semana/Mes).

It ships three presentations of the same meter. You pick one (they don't run at the same time — they show the same data in different ways):

Style What it is Looks like
bar (bar.py) Figures inside the taskbar, next to the clock ✳ D 77% · W 62% · M 63%
tray (tray.py) System-tray icon with the value drawn on it and the detail in the tooltip 63%
panel (meter.py) Floating panel in the corner, with progress bars box with TODAY/WEEK/MONTH

D = today · W = week · M = month, each as a % of its target. Colors update on their own: 🟢 < 70 % · 🟡 < 90 % · 🔴 ≥ 90 %.


⚠️ What it measures (and what it doesn't)

  • ✅ Only the usage of Claude Code running on this computer, reading ~/.claude/projects/**/*.jsonl.
  • ❌ It does not measure Claude on the web/app, the API, or other computers.
  • ❌ It is not your real subscription limit: that number lives on Anthropic's servers and isn't stored locally (you only see it with /usage inside Claude Code).

That's why "what's left" is computed against a personal target you define, not against the plan's limit.

By default it does not count cache reads (cache_read), which would inflate the numbers ~100× as the context is resent. It measures real work: input + output + cache_write.


Requirements

  • Windows 10/11
  • Python 3.9+ (with tkinter, included in the official Python installer)

Install

pip install claude-code-meter

That pulls in the dependencies (Pillow, pystray) and adds a claude-code-meter command. Config and the generated logo are stored in %APPDATA%\ClaudeCodeMeter.

Or from source: git clone … && cd claude-code-meter && pip install -e .

Usage

One command launches the style you choose. You don't need to run several things — pick one.

claude-code-meter          # taskbar (default, recommended)
claude-code-meter tray     # system-tray icon
claude-code-meter panel    # floating panel in the corner

(Equivalent: python -m claude_code_meter.main [bar|tray|panel].)

Adjusting the targets

Right-click on the figures → Adjust target (opens config.json), or create your own config.json from config.example.json:

{
  "daily_budget": null,          // daily target; null = weekly / 7
  "weekly_budget": 10000000,     // tokens/week
  "monthly_budget": 60000000,    // tokens/month
  "count_cache_read": false,     // true = include cache reads
  "refresh_sec": 60
}

Auto-start (Windows)

To start it on boot, put a shortcut in the Startup folder (Win+Rshell:startup) pointing to the installed command:

Target:    …\Scripts\claude-code-meter.exe
Arguments: bar

(claude-code-meter is a GUI script, so it runs without a console window. The repo also ships Iniciar Meter.vbs, which runs pythonw -m claude_code_meter.main bar.)

How the bar version works

Windows 11 repaints the taskbar on top of windows inserted with SetParent, so bar.py uses a topmost window placed by screen coordinates just left of the clock (TrayNotifyWnd) and re-raised every 0.7 s. Same idea as TrafficMonitor / XMeters.

License

MIT — see LICENSE.

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_code_meter-0.1.0.tar.gz (16.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_code_meter-0.1.0-py3-none-any.whl (17.1 kB view details)

Uploaded Python 3

File details

Details for the file claude_code_meter-0.1.0.tar.gz.

File metadata

  • Download URL: claude_code_meter-0.1.0.tar.gz
  • Upload date:
  • Size: 16.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? Yes
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for claude_code_meter-0.1.0.tar.gz
Algorithm Hash digest
SHA256 e2574fe54df4f8cd8302e88ae7afdea2332fe6baa456b641fc75116ce3b0953e
MD5 ecdc43544d70a53264a0ac65ab9e8a18
BLAKE2b-256 190748369bbe8a045bb79d50122cce9668e3366ab7843ef0dacb054e90aae9cc

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_code_meter-0.1.0.tar.gz:

Publisher: publish.yml on marcmayol/claude-code-meter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

File details

Details for the file claude_code_meter-0.1.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_code_meter-0.1.0-py3-none-any.whl
Algorithm Hash digest
SHA256 30be8f81c190467404638f5a4afb8dbcc796b5ae2d07cbf829ca289d939c0261
MD5 643334ce9ffadeac41c807d5845e6908
BLAKE2b-256 782c5f2af0ea7de9ab1d1207d7fa77c3b5641d9bd6ba5f6479facbe1a0686a2d

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_code_meter-0.1.0-py3-none-any.whl:

Publisher: publish.yml on marcmayol/claude-code-meter

Attestations: Values shown here reflect the state when the release was signed and may no longer be current.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page