Skip to main content

Real-time terminal monitor for Claude Code token usage โ€” with keyword analytics, gradient UI, and animated display

Project description

๐ŸŽฏ Claude Code Usage Monitor

PyPI Version Python Version License: MIT

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.

Claude Monitor Screenshot

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! โญ

Report Bug ยท Request Feature

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

wyattmcph_claude_monitor-3.3.1.tar.gz (93.0 kB view details)

Uploaded Source

Built Distribution

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

wyattmcph_claude_monitor-3.3.1-py3-none-any.whl (107.1 kB view details)

Uploaded Python 3

File details

Details for the file wyattmcph_claude_monitor-3.3.1.tar.gz.

File metadata

  • Download URL: wyattmcph_claude_monitor-3.3.1.tar.gz
  • Upload date:
  • Size: 93.0 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for wyattmcph_claude_monitor-3.3.1.tar.gz
Algorithm Hash digest
SHA256 b1925272cf7e37a2f5dd8e1d329b5cecc941f1090557ae64b383423c55cef830
MD5 b8b3e54e002a61f1afd61660117c8056
BLAKE2b-256 ce7e4da78beb312acf0d254a6947457437bbf8bba1941599e4298ec425bb642d

See more details on using hashes here.

File details

Details for the file wyattmcph_claude_monitor-3.3.1-py3-none-any.whl.

File metadata

File hashes

Hashes for wyattmcph_claude_monitor-3.3.1-py3-none-any.whl
Algorithm Hash digest
SHA256 db78aae5044c65a4beeadbbc6c740df218a3a2b457c4c0667ec11d43607d596e
MD5 4e2f2dbb1a7ba22c12a819ca0ede5692
BLAKE2b-256 4ea5242aef2e7e021b1cf94d69e61719dff615387b66765e6dfbd7af1b6f51f6

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