Skip to main content

Real-time token usage monitor for Claude Code

Project description

Claude Code Dashboard

Real-time usage monitoring for Claude Code — with actual utilization data straight from Anthropic's API.

Dashboard Full Dashboard

If you're on Claude Max and want to know where your weekly budget really stands (not a rough estimate — the exact same number shown by /usage), this is for you.


What it does

Claude Code writes every API call to ~/.claude/projects/**/*.jsonl. This dashboard tails those files in real time and layers them with live utilization data from Anthropic's own API, giving you a complete picture of your usage.

Weekly budget panel — pulls seven_day, seven_day_sonnet, and five_hour utilization directly from api.anthropic.com/api/oauth/usage using your existing Claude Code OAuth token (same source as the /usage slash command). Refreshes every 60 seconds.

Burndown chart — week-over-week comparison of your usage pattern, scaled to match Anthropic's real percentages. Useful for spotting if you're burning faster than usual.

Native macOS notifications — fires automatically when you cross 75% or 90% of your weekly budget, and when the 5h rate-limit window is running hot. No third-party apps — just osascript.

Live API call feed — every call as it happens: project, session, tokens, cache hit rate, model.

Real-time activity chart — tokens/min for the last 30 minutes, broken down by input / cache read / output.


Tools

claude_token_live.py — Live Dashboard ⚡

python3 claude_token_live.py           # opens http://localhost:8765
python3 claude_token_live.py --port 9000 --no-browser

Starts a local SSE server. Open the browser and get:

  • Weekly budget: all-models %, Sonnet-only %, 5h-window % — direct from Anthropic
  • Burndown chart: this week vs last week, anchored to real Anthropic utilization
  • Today's tokens: stacked input / cache write / cache read / output
  • Current session: live token counter for your active Claude Code session
  • Live call feed: last 60 API calls with timing, cache efficiency, model used
  • Activity chart: tokens/min rolling 30-minute window

Polls log files every 400ms. Anthropic API is called every 60s in a background thread.

Requirements: Python 3.9+ · macOS (uses Keychain for OAuth token) · Claude Code installed

No pip install needed — zero external dependencies.


claude_burndown.py — Weekly Burndown Chart

python3 claude_burndown.py             # opens in browser
python3 claude_burndown.py --no-browser > burndown.html

Generates a static HTML chart showing multiple billing cycles overlaid. Each line = one week (Fri 9am → Thu 9am Madrid time). The current week is highlighted in orange.

Useful for understanding your weekly consumption patterns at a glance.


claude_token_dashboard.py — Full Historical Dashboard

python3 claude_token_dashboard.py

One-shot HTML report with everything: daily breakdown, hourly heatmap, cache efficiency, model distribution, anomaly detection, top sessions.


analyze_tokens.py — CLI Summary

python3 analyze_tokens.py

Text report: totals, per-project, daily breakdown, anomaly alerts, top sessions.


How the weekly % works

Claude Code stores its OAuth token in your macOS Keychain under Claude Code-credentials. The live dashboard reads it at runtime and calls:

GET https://api.anthropic.com/api/oauth/usage
Authorization: Bearer <your token>
anthropic-beta: oauth-2025-04-20

The response includes the exact same utilization data that /usage shows interactively. Your token never leaves your machine — the call goes directly from your machine to Anthropic, same as any other Claude Code API call.


Data & privacy

  • All processing is local
  • Log files (~/.claude/projects/) are read-only, never modified
  • The only outbound call is to api.anthropic.com with your own OAuth token to fetch your own usage data
  • Nothing is sent to third parties

Billing cycle

Anthropic resets the weekly budget every Friday at 9:00 AM Madrid time (07:00 UTC in CEST, 08:00 UTC in CET). The dashboard uses this reset time for cycle boundaries.

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_token_dashboard-0.2.0.tar.gz (49.1 kB view details)

Uploaded Source

Built Distribution

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

claude_token_dashboard-0.2.0-py3-none-any.whl (53.3 kB view details)

Uploaded Python 3

File details

Details for the file claude_token_dashboard-0.2.0.tar.gz.

File metadata

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

File hashes

Hashes for claude_token_dashboard-0.2.0.tar.gz
Algorithm Hash digest
SHA256 c7c0d585982235b37b6a5da8523381f6fa439aa836f139d6e73fe0741869b4be
MD5 d4d62be62182f9a4446abc5168ff0ba1
BLAKE2b-256 83d60af853d7298522c8dd6867f170868d47b85b29d253444da9acdcac7abd92

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_token_dashboard-0.2.0.tar.gz:

Publisher: publish.yml on xaviguardia/claudedashboard

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_token_dashboard-0.2.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_token_dashboard-0.2.0-py3-none-any.whl
Algorithm Hash digest
SHA256 64bf9c970ae061c3678182890d255455909e26f52ddccc42d14ed2484930a667
MD5 d3e800f8d1354332ec482ab922a7f201
BLAKE2b-256 ede4b3dc1970351b08b2776f7cb47c2340e7f02a192767dfb84bbeadd92be427

See more details on using hashes here.

Provenance

The following attestation bundles were made for claude_token_dashboard-0.2.0-py3-none-any.whl:

Publisher: publish.yml on xaviguardia/claudedashboard

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