Skip to main content

Zero-dependency real-time Claude Code usage monitor

Project description

cwatch

Real-time Claude Code usage monitor. Zero dependencies.

pip install cwatch
cwatch
──────────────────────────────────────────────────────────
  CLAUDE CODE  ·  USAGE MONITOR
──────────────────────────────────────────────────────────

  5-hour session
  [████████████░░░░░░░░░░░░░]   48%  reset in 2h 31m (18:00:00)

  7-day window
  [████░░░░░░░░░░░░░░░░░░░░░]   18%  reset in 4d 12h (Sat 00:00)

──────────────────────────────────────────────────────────
  Updated 15:28:43   ·   Ctrl+C to exit

Why cwatch?

cwatch claude-monitor
Dependencies zero (stdlib only) Rich, Pydantic, pytz…
Data source live OAuth API local JSONL files
Install pip install cwatch requires ccusage (npm) + pip
Python 3.9+ 3.9+

cwatch reads the same internal API endpoint that Claude Code itself uses — numbers are exact and real-time, no token-counting heuristics.

Install

pip install cwatch
# or isolated (recommended)
pipx install cwatch
uv tool install cwatch

Requires: Python 3.9+ and having run claude login at least once.

Usage

cwatch                        # live dashboard, refresh every 60s
cwatch --interval 30          # faster refresh
cwatch --once                 # one compact line, then exit
cwatch --json                 # raw API JSON dump
cwatch --token sk-ant-oat01-… # explicit token
CLAUDE_TOKEN=sk-… cwatch      # token via env var

tmux statusline

set -g status-right "#(cwatch --once)  %H:%M"
set -g status-interval 60

How it works

Calls GET https://api.anthropic.com/api/oauth/usage with your Claude Code OAuth token (read from macOS Keychain, ~/.claude/.credentials.json, or CLAUDE_TOKEN env var).

Python API

from cwatch.credentials import get_token
from cwatch.api import fetch

data = fetch(get_token())
print(f"5h session: {data.five_hour.pct}%  resets in {data.five_hour.time_until_reset}")

Contributing

PRs welcome. Please keep the zero-dependencies constraint.

git clone https://github.com/YOUR_USER/cwatch && cd cwatch
pip install -e . && pytest

License

MIT © 2026

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

cwatch_monitor-0.5.0.tar.gz (13.1 kB view details)

Uploaded Source

Built Distribution

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

cwatch_monitor-0.5.0-py3-none-any.whl (14.8 kB view details)

Uploaded Python 3

File details

Details for the file cwatch_monitor-0.5.0.tar.gz.

File metadata

  • Download URL: cwatch_monitor-0.5.0.tar.gz
  • Upload date:
  • Size: 13.1 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for cwatch_monitor-0.5.0.tar.gz
Algorithm Hash digest
SHA256 8c2cd6aeac6532b21dd52fd464b60feb2704a1d5213ce9992f2be1f8ab7e5ee7
MD5 98e5f6bc54b36be9c440b2697b211b3c
BLAKE2b-256 fd7b60fa8a6fbba633d4da8033c99bc4f1f7ebced3d890f329810d4022045038

See more details on using hashes here.

File details

Details for the file cwatch_monitor-0.5.0-py3-none-any.whl.

File metadata

  • Download URL: cwatch_monitor-0.5.0-py3-none-any.whl
  • Upload date:
  • Size: 14.8 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.2.0 CPython/3.9.6

File hashes

Hashes for cwatch_monitor-0.5.0-py3-none-any.whl
Algorithm Hash digest
SHA256 2ac53a587ee21f914aa9f24a34ef18868a95d76fa896d8dfbe7e3eada492805f
MD5 c6977471aef4e8124e99d64aad7b7dd9
BLAKE2b-256 4a2ea444ec7fe6954d3610dd4a97d4c8e69ac41de2d008466200c5e9bfeae6e8

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