Real-time Claude Code usage monitor with predictions and warnings
# Add to your Claude Code skills
git clone https://github.com/Maciek-roboblog/Claude-Code-Usage-MonitorA beautiful real-time terminal monitoring tool for Claude AI token usage with advanced analytics, machine learning-based predictions, and Rich UI. Track your token consumption, burn rate, cost analysis, and get intelligent predictions about session limits.

No comments yet. Be the first to share your thoughts!
The Custom plan is now the default option, specifically designed for 5-hour Claude Code sessions. It monitors three critical metrics:
The Custom plan automatically adapts to your usage patterns by analyzing all your sessions from the last 192 hours (8 days) and calculating personalized limits based on your actual usage. This ensures accurate predictions and warnings tailored to your specific workflow.
Why uv is the best choice:
The fastest and easiest way to install and use the monitor:
# Install directly from PyPI with uv (easiest)
uv tool install claude-monitor
# Run from anywhere
claude-monitor # or cmonitor, ccmonitor for short
# Clone and install from source
git clone https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor.git
cd Claude-Code-Usage-Monitor
uv tool install .
# Run from anywhere
claude-monitor
If you don't have uv installed yet, get it with one command:
# On Linux/macOS:
curl -LsSf https://astral.sh/uv/install.sh | sh
# On Windows:
powershell -ExecutionPolicy ByPass -c "irm https://astral.sh/uv/install.ps1 | iex"
# After installation, restart your terminal
# Install from PyPI
pip install claude-monitor
# If claude-monitor command is not found, add ~/.local/bin to PATH:
echo 'export PATH="$HOME/.local/bin:$PATH"' >> ~/.bashrc
source ~/.bashrc # or restart your terminal
# Run from anywhere
claude-monitor # or cmonitor, ccmonitor for short
โ ๏ธ PATH Setup: If you see WARNING: The script claude-monitor is installed in '/home/username/.local/bin' which is not on PATH, follow the export PATH command above.
โ ๏ธ Important: On modern Linux distributions (Ubuntu 23.04+, Debian 12+, Fedora 38+), you may encounter an "externally-managed-environment" error. Instead of using --break-system-packages, we strongly recommend:
- Use uv instead (see above) - it's safer and easier
- Use a virtual environment - python3 -m venv myenv && source myenv/bin/activate
- Use pipx - pipx install claude-monitor
See the Troubleshooting section for detailed solutions.
# Install with pipx
pipx install claude-monitor
# Run from anywhere
claude-monitor # or claude-code-monitor, cmonitor, ccmonitor, ccm for short
# Install with pip in conda environment
pip install claude-monitor
# Run from anywhere
claude-monitor # or cmonitor, ccmonitor for short
# Show help information
claude-monitor --help
| Parameter | Type | Default | Description | |-----------|------|---------|-------------| | --plan | string | custom | Plan type: pro, max5, max20, or custom | | --custom-limit-tokens | int | None | Token limit for custom plan (must be > 0) | | --view | string | realtime | View type: realtime, daily, or monthly | | --timezone | string | auto | Timezone (auto-detected). Examples: UTC, America/New_York, Europe/London | | --time-format | string | auto | Time format: 12h, 24h, or auto | | --theme | string | auto | Display theme: light, dark, classic, or auto | | --refresh-rate | int | 10 | Data refresh rate in seconds (1-60) | | --refresh-per-second | float | 0.75 | Display refresh rate in Hz (0.1-20.0) | | --reset-hour | int | None | Daily reset hour (0-23) | | --log-level | string | INFO | Logging level: DEBUG, INFO, WARNING, ERROR, CRITICAL | | --log-file | path | None | Log file path | | --debug | flag | False | Enable debug logging | | --version, -v | flag | False | Show version information | | --clear | flag | False | Clear saved configuration |
| Plan | Token Limit | Cost Limit | Description | |------|-------------|------------------|-------------| | pro | 19,000 | $18.00 | Claude Pro subscription | | max5 | 88,000 | $35.00 | Claude Max5 subscription | | max20 | 220,000 | $140.00 | Claude Max20 subscription | | custom | P90-based | (default) $50.00 | Auto-detection with ML analysis |
The tool can be invoked using any of these commands:
The monitor automatically saves your preferences to avoid re-specifying them on each run:
What Gets Saved:
Configuration Location: ~/.claude-monitor/last_used.json
Usage Examples:
# First run - specify preferences
claude-monitor --plan pro --theme dark --timezone "America/New_York"
# Subsequent runs - preferences automatically restored
claude-monitor --plan pro
# Override saved settings for this session
claude-monitor --plan pro --theme light
# Clear all saved preferences
claude-monitor --clear
Key Features:
# Default (Custom plan with auto-detection)
claude-monitor
# Alternative commands
claude-code-monitor # Full descr