Skip to main content

Measure your actual Claude Code usage limits instead of guessing

Project description

ccmeter

measure your actual claude code usage limits instead of guessing.

why

anthropic shows you a percentage bar. 21% used. but 21% of what? they've never said.

twice in four months, limits changed during or after promotions. both times the community noticed. both times the explanation was "contrast effect." without numbers, you can't tell the difference between "i'm using more" and "they gave me less."

ccmeter gives you the number. track it over time. if it drops, the cap shrank. see docs/incidents.md for the receipts.

what it measures

from a max 20x subscriber running opus:

5h window:  $363 budget  = 20x × $18 pro base
7d window:  $1,900 budget  = 20x × $95 pro base

the dollar amount isn't about sub vs api. it's the only unit that makes different token types comparable — cache reads are 10x cheaper than input tokens, so raw totals are meaningless. cost-weighting normalizes everything into one number you can track.

every report stores the budget. next run shows the delta. if your budget drops 5% overnight, you see it in red. across enough users, a simultaneous drop is undeniable.

how it works

  1. poll — records utilization from anthropic's usage API every 2 minutes
  2. scan — reads per-message token counts from claude code's local JSONL logs
  3. calibrate — when utilization ticks from 15% to 16%, it knows what tokens were used in that window. cost-weight them. that's your budget per percent.

install

pip install ccmeter

or clone and run directly:

git clone https://github.com/iteebz/ccmeter && cd ccmeter && uv sync

requires python 3.12+, claude code installed and signed in. macos and linux. zero dependencies beyond fncli.

usage

ccmeter install          # background daemon, survives restarts
ccmeter report           # budget, burn rate, binding constraint
ccmeter report --json    # structured output for sharing
ccmeter status           # live utilization, burn rate, daemon health
ccmeter trend            # budget over time as a sparkline chart
ccmeter account          # show account info, plan, tier
ccmeter account --pin    # lock to current account (filters shared machines)
ccmeter history          # raw usage tick history
ccmeter poll --fast      # 60s interval for higher resolution
ccmeter uninstall        # remove daemon

needs a few days of data collection before calibration kicks in. install it, let it run, check back.

claude code only

ccmeter reads token data from local session logs that only claude code produces. if you use claude.ai or cowork at the same time, token counts get inflated because the API tracks combined usage but we only see claude code's logs. for cleanest data, use claude code as your primary surface.

what it collects

from anthropic's API (polled every 2 min, recorded on change):

  • utilization percentage per bucket (five_hour, seven_day, etc.)
  • reset timestamps
  • subscription tier (detected from credentials)

from claude code's local JSONL files (scanned on report):

  • per-message token counts: input, output, cache_read, cache_create
  • model, timestamps, session id
  • tool calls, reads, edits, bash commands, lines changed

everything stays local in ~/.ccmeter/meter.db. your oauth token only goes to anthropic's own API — the same call claude code already makes.

known confounds

  • multi-surface usage — claude.ai, cowork, and claude code share limits but only claude code has local token logs. simultaneous use inflates counts.
  • 1% granularity — the API reports whole percentages only. more samples over longer periods = better accuracy.
  • cache write TTL — anthropic charges different rates for 5-minute vs 1-hour cache writes. JSONL doesn't distinguish which was used. ccmeter uses the 5m price, which may underestimate by ~8% if claude code uses 1h caching.
  • effort level — opus defaults to medium effort for max subscribers. medium = fewer output tokens = less budget. not observable from JSONL. sessions at high effort cost more per percent.
  • pro base is derived — the pro base number is your budget divided by your tier multiplier. it's a prediction, not a measurement. a pro user running ccmeter would confirm it.

see docs/source.md for confirmed implementation details from the claude code source.

help

the more people running this across tiers (pro, max 5x, max 20x, team) and models (sonnet, opus, haiku), the harder it gets to change limits without anyone noticing.

install it. let the daemon run. share your ccmeter report output.

if you want to contribute code: see CONTRIBUTING.md.

license

MIT

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

ccmeter-0.1.8.tar.gz (52.8 kB view details)

Uploaded Source

Built Distribution

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

ccmeter-0.1.8-py3-none-any.whl (39.9 kB view details)

Uploaded Python 3

File details

Details for the file ccmeter-0.1.8.tar.gz.

File metadata

  • Download URL: ccmeter-0.1.8.tar.gz
  • Upload date:
  • Size: 52.8 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ccmeter-0.1.8.tar.gz
Algorithm Hash digest
SHA256 20658513a8b8045ae44447c19a6b9e54ac445b9ee5d2ae87b8e3222f9cf5c059
MD5 bb51873f9ee5d11b25478365ada5968e
BLAKE2b-256 e34148ca532c6080d39cd7b39ed34ec5995586f022df8937264c1fcdd6a8a142

See more details on using hashes here.

File details

Details for the file ccmeter-0.1.8-py3-none-any.whl.

File metadata

  • Download URL: ccmeter-0.1.8-py3-none-any.whl
  • Upload date:
  • Size: 39.9 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: uv/0.9.18 {"installer":{"name":"uv","version":"0.9.18","subcommand":["publish"]},"python":null,"implementation":{"name":null,"version":null},"distro":{"name":"macOS","version":null,"id":null,"libc":null},"system":{"name":null,"release":null},"cpu":null,"openssl_version":null,"setuptools_version":null,"rustc_version":null,"ci":null}

File hashes

Hashes for ccmeter-0.1.8-py3-none-any.whl
Algorithm Hash digest
SHA256 edc1adc9fc8849b8ee41d563ea1564b8d53582e8fd7584e4213f59ec52721979
MD5 99f0e0be5d3f7265cfd4732264e00617
BLAKE2b-256 541b6a72fc8e6f452225be816ff34c0fb698db8ef9add95da7ee0b7ef39893ec

See more details on using hashes here.

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