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. Shows token usage, session cost, burn rate, and keyword analytics so you know exactly how you're spending your plan limits.

Fork of Maciek-roboblog/Claude-Code-Usage-Monitor, extended with keyword analytics, an interactive settings menu, adaptive layout, and a floating popup window.


Installation

Download a binary (no Python required)

Go to the Releases page and download the file for your platform:

Platform File
Windows claude-monitor-windows.exe
macOS claude-monitor-macos
Linux claude-monitor-linux

Windows: Double-click to run, or run it from any terminal. Windows Defender may show a SmartScreen warning the first time — click "More info" then "Run anyway". This happens because the executable is not code-signed.

macOS: Right-click the file and choose Open the first time, then click Open in the dialog. macOS blocks unsigned binaries from double-clicking until you explicitly allow them once. After that it runs normally.

Linux:

chmod +x claude-monitor-linux
./claude-monitor-linux

Install with uv or pip (Python required)

If you already have Python set up and prefer package management:

# Windows — install uv if you don't have it
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# macOS / Linux
curl -LsSf https://astral.sh/uv/install.sh | sh
uv tool install wyattmcph-claude-monitor
claude-monitor

Or with pip:

pip install wyattmcph-claude-monitor
claude-monitor

From source:

pip install git+https://github.com/wyattmcph/wyattmcph-claude-monitor.git

Usage

claude-monitor          # start the monitor
cmonitor                # short alias
ccm                     # shortest alias
claude-monitor --config # open the settings menu without starting the monitor

First run shows a quick plan picker so you start with the right limits. Press m at any time to change settings while the monitor is running.

Keyboard shortcuts (while running)

Key Action
m Open the settings menu
k Toggle the keyword analytics panel
a Cycle animation level
Ctrl+C Exit

All options

Flag Default Description
--plan pro pro, max5, max20, or custom
--custom-limit-tokens Explicit token cap for custom plan
--view realtime realtime, daily, or monthly
--animation subtle none, subtle, moderate, or full
--keywords Comma-separated topics to track, e.g. "unreal,python"
--show-keywords on Pass --no-show-keywords to hide the keyword panel
--popup Launch as a floating always-on-top window
--config Open settings menu without starting the monitor
--timezone auto Any valid timezone, e.g. America/New_York
--time-format auto 12h, 24h, or auto
--theme auto light, dark, classic, or auto
--refresh-rate 10 Seconds between data updates (1-60)
--refresh-per-second 0.75 Display refresh rate in Hz (0.1-20)
--reset-hour Override daily reset hour (0-23)
--log-file Write logs to this path
--log-level INFO DEBUG, INFO, WARNING, or ERROR
--debug Shorthand for --log-level DEBUG
--clear Wipe saved preferences
--version / -v Print version and exit

Settings are saved to ~/.claude-monitor/last_used.json and restored on the next run. Passing any flag explicitly overrides the saved value for that session.


Plans

Plan Token limit Cost limit Use when
pro ~19,000 $18 Claude Pro ($20/mo)
max5 ~88,000 $35 Claude Max ($100/mo)
max20 ~220,000 $140 Claude Max ($200/mo)
custom P90 auto-detect ~$50 Unknown or variable limits

The custom plan looks at the last 8 days of your session history and uses the 90th-percentile values as your limits. It adapts over time but can read high on the first run.


Keyword Analytics

The keyword panel tracks how many tokens and dollars went to conversations about specific topics.

Quick session tracking:

claude-monitor --keywords "unreal,python,git"

Persistent list -- create ~/.claude-monitor/keywords.txt, one keyword per line:

# My projects
unreal
blueprint
python
git
debugging

The file is created automatically on first run with some common defaults. Edit it, or use the settings menu (m then 7) to add keywords interactively.

The --keywords flag overrides the file for that session.


Popup window

Run a compact floating overlay alongside your Claude window:

claude-monitor --popup

The window is always on top, draggable, and resizable. The button in the header cycles between display sizes. Requires tkinter, which comes with Python on Windows and macOS. On Linux: sudo apt install python3-tk.


Adaptive layout

The display automatically adjusts to your terminal size:

Terminal height What shows
Under 18 rows Token bar, cost, burn rate, status line
18-27 rows Core metrics and predictions
28-37 rows Full session stats
38+ rows Full stats plus keyword panel

Bar widths also adjust to terminal width. The keyword panel is always the first thing hidden when you shrink the window and the last thing added when you expand it.


Views

claude-monitor --view realtime   # live monitor (default)
claude-monitor --view daily      # daily usage table
claude-monitor --view monthly    # monthly usage table

How sessions work

Claude Code uses 5-hour rolling session windows. A session starts with your first message and runs for exactly 5 hours. Token and cost limits apply per window. The monitor tracks the active session and shows a prediction for when tokens will run out.


Examples

# Pro plan, US East Coast, track Unreal work
claude-monitor --plan pro --timezone America/New_York --keywords "unreal,blueprint"

# Max5 plan with sparkline chart
claude-monitor --plan max5 --animation moderate

# Daily usage summary
claude-monitor --view daily

# Popup window for side-by-side with Claude
claude-monitor --popup

# Reset all saved settings
claude-monitor --clear

Development

git clone https://github.com/wyattmcph/wyattmcph-claude-monitor.git
cd wyattmcph-claude-monitor
pip install -e ".[dev]"
python -m pytest src/tests/ -q
python -m claude_monitor

Troubleshooting

"externally-managed-environment" error on Linux Use uv tool install wyattmcph-claude-monitor or pipx install wyattmcph-claude-monitor instead of bare pip.

Command not found after pip install

echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc && source ~/.bashrc

No data showing Send at least one message in Claude Code first, then wait one refresh cycle (default 10 seconds).

Numbers seem too high or too low You probably have the wrong plan selected. Press m and choose option 1 to set your plan.

Keyword panel not appearing The panel needs at least one keyword configured. It also only shows when your terminal is tall enough (38+ rows). Press k to toggle it or resize the window.


License

MIT

Credits

Original monitor by Maciek-roboblog. Extended by wyattmcph.

Report a bug · Request a 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.4.1.tar.gz (97.6 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.4.1-py3-none-any.whl (112.3 kB view details)

Uploaded Python 3

File details

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

File metadata

  • Download URL: wyattmcph_claude_monitor-3.4.1.tar.gz
  • Upload date:
  • Size: 97.6 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.4.1.tar.gz
Algorithm Hash digest
SHA256 2060f52a37caaa5435cf46b636052c11baa456b0923f35ee7c522ca21ca4c854
MD5 8cf93c278360bd841bf807d3929fe988
BLAKE2b-256 82c7f938cb072a751edbdadf591d0a169a7465d28e04ea7378f0b21a55d89c92

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for wyattmcph_claude_monitor-3.4.1-py3-none-any.whl
Algorithm Hash digest
SHA256 8fdd9cacccb334c1f899071300f5db0358ddd4b436da2b38e432317083031d01
MD5 d465c24eadc8c3e86a2f35be32aa368e
BLAKE2b-256 14d38392bbcbfd7cd1a064d88dba6f3d8f2cc7a4b8e5cda4a064ad7542402ee5

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