Real-time terminal monitor for Claude Code token usage โ with keyword analytics, gradient UI, and animated display
Project description
๐ฏ Claude Code Usage Monitor
A real-time terminal monitor for Claude Code token usage โ with keyword analytics, gradient progress bars, an animated Rich UI, and burn-rate sparklines. Track exactly where your tokens and budget are going, broken down by topic.
Fork of Maciek-roboblog/Claude-Code-Usage-Monitor โ extended with keyword analytics and visual improvements in v3.2.0.
โจ What's New in v3.2.0
| Feature | Description |
|---|---|
| ๐ Keyword Analytics | See how many tokens and dollars went to conversations about unreal, python, git, or any topic you care about |
| ๐จ Gradient Progress Bars | Bars fill green โ yellow โ red so you instantly know how urgent each metric is |
| โจ Rich Panel Header | Bordered header with plan-colour coding and an animated LIVE dot |
| ๐ Burn Rate Sparkline | Inline โโโโโ
โโโ chart of your last 20 burn-rate samples |
| ๐๏ธ Animation Levels | --animation none/subtle/moderate/full โ pick how much motion you want |
๐ Installation
Recommended โ uv (fastest, no environment issues)
# Install uv if you don't have it (Windows)
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# Install uv (macOS / Linux)
curl -LsSf https://astral.sh/uv/install.sh | sh
# Then install the monitor
uv tool install wyattmcph-claude-monitor
# Run it
claude-monitor
pip
pip install wyattmcph-claude-monitor
claude-monitor
pipx
pipx install wyattmcph-claude-monitor
claude-monitor
Install from source (latest changes)
pip install git+https://github.com/wyattmcph/wyattmcph-claude-monitor.git
๐ Usage
claude-monitor # default (custom plan, auto-detects limits)
cmonitor # short alias
ccm # shortest alias
claude-code-monitor # full alias
All CLI Options
| Flag | Default | Description |
|---|---|---|
--plan |
custom |
pro ยท max5 ยท max20 ยท custom |
--custom-limit-tokens |
โ | Explicit token cap for custom plan |
--view |
realtime |
realtime ยท daily ยท monthly |
--animation |
subtle |
none ยท subtle ยท moderate ยท full |
--keywords |
โ | Comma-separated topics to track (e.g. "unreal,python") |
--timezone |
auto | Any valid timezone, e.g. America/New_York |
--time-format |
auto | 12h ยท 24h ยท auto |
--theme |
auto | light ยท dark ยท classic ยท auto |
--refresh-rate |
10 |
Data refresh in seconds (1โ60) |
--refresh-per-second |
0.75 |
Display refresh in Hz (0.1โ20) |
--reset-hour |
โ | Override daily reset hour (0โ23) |
--log-file |
โ | Path to write log output |
--log-level |
INFO |
DEBUG ยท INFO ยท WARNING ยท ERROR |
--debug |
โ | Shorthand for --log-level DEBUG |
--clear |
โ | Wipe saved preferences |
--version / -v |
โ | Print version and exit |
Your preferences (theme, timezone, animation level, etc.) are saved automatically to ~/.claude-monitor/last_used.json and restored on the next run. Pass any flag explicitly to override just for that session.
๐ Keyword Analytics
Track exactly how much of your Claude budget went towards specific topics.
Quick start
# Track a few topics right now
claude-monitor --keywords "unreal,python,git"
Persistent keyword list
Create ~/.claude-monitor/keywords.txt โ one keyword per line, # for comments:
# My keyword list
unreal
blueprint
python
git
debugging
The CLI --keywords flag always overrides the file for that session.
What the panel shows
Once keywords are configured a panel appears below the live display:
โญโ ๐ Keyword Analytics โโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฎ
โ Keyword Convos Mentions Tokens Cost % Cost Bar โ
โ #unreal 12 143 842,301 $14.23 31.2% โโโโโโโโโโ โ
โ #python 8 67 421,050 $7.88 17.3% โโโโโโโโโโ โ
โ #git 5 31 187,200 $3.12 6.8% โโโโโโโโโโ โ
โฐโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโโฏ
๐๏ธ Animation Levels
claude-monitor --animation subtle # pulsing LIVE dot only (default)
claude-monitor --animation moderate # LIVE dot + burn-rate sparkline
claude-monitor --animation full # everything on
claude-monitor --animation none # completely static
The setting is remembered between runs.
๐ Plan Reference
| Plan | Token Limit | Cost Limit | Best For |
|---|---|---|---|
custom |
P90 auto-detect | ~$50 | Default โ adapts to your history |
pro |
~19,000 | $18 | Claude Pro subscription |
max5 |
~88,000 | $35 | Claude Max5 subscription |
max20 |
~220,000 | $140 | Claude Max20 subscription |
The custom plan analyses the last 8 days of your sessions and uses the 90th-percentile token and cost values as your limits, so it adapts to how you actually work.
๐ฅ๏ธ Usage Views
claude-monitor --view realtime # live monitor (default)
claude-monitor --view daily # daily usage table
claude-monitor --view monthly # monthly usage table
๐ Common Examples
# US East Coast, dark theme, track Unreal work
claude-monitor --timezone America/New_York --theme dark --keywords "unreal,blueprint"
# Max5 plan with sparkline enabled
claude-monitor --plan max5 --animation moderate
# Daily usage summary
claude-monitor --view daily --timezone UTC
# Debug mode with log file
claude-monitor --debug --log-file ~/.claude-monitor/debug.log
# Reset all saved settings
claude-monitor --clear
๐ง How Sessions Work
Claude Code uses 5-hour rolling session windows:
- A session starts with your first message and lasts exactly 5 hours
- Token and cost limits apply per session window
- You can have multiple overlapping sessions simultaneously
- The monitor tracks the active session and predicts when it will run out
๐ ๏ธ Development Setup
# Clone this fork
git clone https://github.com/wyattmcph/wyattmcph-claude-monitor.git
cd Claude-Code-Usage-Monitor-and-Analyze
# Install in editable mode with dev dependencies
pip install -e ".[dev]"
# Run tests
python -m pytest src/tests/ -q
# Run from source
python -m claude_monitor
๐ Troubleshooting
"externally-managed-environment" error on Linux
Use uv tool install claude-monitor or pipx install claude-monitor instead of bare pip.
claude-monitor command not found after pip install
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc
No active session / no data showing Send at least one message in Claude Code first, then wait one refresh cycle (default 10 seconds).
Keywords panel not appearing
Make sure you've either created ~/.claude-monitor/keywords.txt or passed --keywords "...". The panel only shows when at least one keyword is configured.
๐ License
MIT โ use and modify freely.
๐ Credits
Built on top of the excellent original by Maciek-roboblog. Extended with keyword analytics and visual improvements by wyattmcph.
โญ Star this repo if you find it useful! โญ
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file wyattmcph_claude_monitor-3.3.0.tar.gz.
File metadata
- Download URL: wyattmcph_claude_monitor-3.3.0.tar.gz
- Upload date:
- Size: 86.9 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
eba937eff128916360465bbfc9633243a96ff85c5bf4f3c3767f4ef3456e6ea3
|
|
| MD5 |
2bf6659328a221b590d8885c0c0538ce
|
|
| BLAKE2b-256 |
951980faf4f3ae9951ca0f232f43c3692624b941672b1a21ae1eda4efa1c1810
|
File details
Details for the file wyattmcph_claude_monitor-3.3.0-py3-none-any.whl.
File metadata
- Download URL: wyattmcph_claude_monitor-3.3.0-py3-none-any.whl
- Upload date:
- Size: 100.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.12
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
90262b2e265d8f784ce08bcba57c4e9aec9df2771c1cc92538ab844812f383c8
|
|
| MD5 |
f6133f32f0a27573e61e227fbb4cad3a
|
|
| BLAKE2b-256 |
c33db8d339cc2713c986c540c3c8e08a0be1f2c6e2afa923e9dfc3742b6a9ee4
|