Real-time Claude Code usage monitor with predictions and warnings
- ✓Open-source license (MIT)
- ✓Clear description
- ✓Topics declared
- ✓Documented (README)
- !Inactive (>180d)
{
"mcpServers": {
"claude-code-usage-monitor": {
"command": "python",
"args": ["-m", "claude_monitor"]
}
}
}~/Library/Application Support/Claude/claude_desktop_config.json (Mac) or %APPDATA%\Claude\claude_desktop_config.json (Windows).<placeholder> values with your API keys or paths.Resumen de Tools
# 🎯 Claude Code Usage Monitor [](https://pypi.org/project/claude-monitor/) [](https://python.org) [](https://opensource.org/licenses/MIT) [](http://makeapullrequest.com) [](https://codecov.io/gh/Maciek-roboblog/Claude-Code-Usage-Monitor) A 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.  --- ## 📑 Table of Contents - [✨ Key Features](#-key-features) - [🚀 Installation](#-installation) - [⚡ Modern Installation with uv (Recommended)](#-modern-installation-with-uv-recommended) - [📦 Installation with pip](#-installation-with-pip) - [🛠️ Other Package Managers](#️-other-package-managers) - [📖 Usage](#-usage) - [Get Help](#get-help) - [Basic Usage](#basic-usage) - [Configuration Options](#configuration-options) - [Available Plans](#available-plans) - [🙏 Please Help Test This Release!](#-please-help-test-this-release) - [✨ Features & How It Works](#-features--how-it-works) - [Current Features](#current-features) - [Understanding Claude Sessions](#understanding-claude-sessions) - [Token Limits by Plan](#token-limits-by-plan) - [Smart Detection Features](#smart-detection-features) - [🚀 Usage Examples](#-usage-examples) - [Common Scenarios](#common-scenarios) - [Best Practices](#best-practices) - [🔧 Development Installation](#-development-installation) - [Troubleshooting](#troubleshooting) - [Installation Issues](#installation-issues) - [Runtime Issues](#runtime-issues) - [📞 Contact](#-contact) - [📚 Additional Documentation](#-additional-documentation) - [📝 License](#-license) - [🤝 Contributors](#-contributors) - [🙏 Acknowledgments](#-acknowledgments) ## ✨ Key Features ### 🚀 **v3.0.0 Major Update - Complete Architecture Rewrite** - **🔮 ML-based predictions** - P90 percentile calculations and intelligent session limit detection - **🔄 Real-time monitoring** - Configurable refresh rates (0.1-20 Hz) with intelligent display updates - **📊 Advanced Rich UI** - Beautiful color-coded progress bars, tables, and layouts with WCAG-compliant contrast - **🤖 Smart auto-detection** - Automatic plan switching with custom limit discovery - **📋 Enhanced plan support** - Updated limits: Pro (44k), Max5 (88k), Max20 (220k), Custom (P90-based) - **⚠️ Advanced warning system** - Multi-level alerts with cost and time predictions - **💼 Professional Architecture** - Modular design with Single Responsibility Principle (SRP) compliance - **🎨 Intelligent theming** - Scientific color schemes with automatic terminal background detection - **⏰ Advanced scheduling** - Auto-detected system timezone and time format preferences - **📈 Cost analytics** - Model-specific pricing with cache token calculations - **🔧 Pydantic validation** - Type-safe configuration with automatic validation - **📝 Comprehensive logging** - Optional file logging with configurable levels - **🧪 Extensive testing** - 100+ test cases with full coverage - **🎯 Error reporting** - Optional Sentry integration for production monitoring - **⚡ Performance optimized** - Advanced caching and efficient data processing ### 📋 Default Custom Plan The **Custom plan** is now the default option, specifically designed for 5-hour Claude Code sessions. It monitors three critical metrics: - **Token usage** - Tracks your token consumption - **Messages usage** - Monitors message count - **Cost usage** - The most important metric for long sessions 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. ## 🚀 Installation ### ⚡ Modern Installation with uv (Recommended) **Why uv is the best choice:** - ✅ Creates isolated environments automatically (no system conflicts) - ✅ No Python version issues - ✅ No "externally-managed-environment" errors - ✅ Easy updates and uninstallation - ✅ Works on all platforms The fastest and easiest way to install and use the monitor: [](https://pypi.org/project/claude-monitor/) #### Install from PyPI ```bash # Install directly from PyPI with uv (easiest) uv tool install claude-monitor # Run from anywhere claude-monitor # or cmonitor, ccmonitor for short ``` #### Install from Source ```bash # 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 ``` #### First-time uv users If you don't have uv installed yet, get it with one command: ```bash # 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 ``` ### 📦 Installation with pip ```bash # 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: > 1. **Use uv instead** (see above) - it's safer and easier > 2. **Use a virtual environment** - python3 -m venv myenv && source myenv/bin/activate > 3. **Use pipx** - pipx install claude-monitor > > See the Troubleshooting section for detailed solutions. ### 🛠️ Other Package Managers #### pipx (Isolated Environments) ```bash # Install with pipx pipx install claude-monitor # Run from anywhere claude-monitor # or claude-code-monitor, cmonitor, ccmonitor, ccm for short ``` #### conda/mamba ```bash # Install with pip in conda environment pip install claude-monitor # Run from anywhere claude-monitor # or cmonitor, ccmonitor for short ``` ## 📖 Usage ### Get Help ```bash # Show help information claude-monitor --help ``` #### Available Command-Line Parameters | 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 Options | 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 | #### Command Aliases The tool can be invoked using any of these commands: - claude-monitor (primary) - claude-code-monitor (full name) - cmonitor (short) - ccmonitor (short alternative) - ccm (shortest) #### Save Flags Feature The monitor automatically saves your preferences to avoid re-specifying them on each run: **What Gets Saved:** - View type (--view) - Theme preferences (--theme) - Timezone settings (--timezone) - Time format (--time-format) - Refresh rates (--refresh-rate, --refresh-per-second) - Reset hour (--reset-hour) - Custom token limits (--custom-limit-tokens) **Configuration Location:** ~/.claude-monitor/last_used.json **Usage Examples:** ```bash # 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:** - ✅ Automatic parameter persistence between sessions - ✅ CLI arguments always override saved settings - ✅ Atomic file operations prevent corruption - ✅ Graceful fallback if config files are damaged - ✅ Plan parameter never saved (must specify each time) ### Basic Usage #### With uv tool installation (Recommended) ```bash # Default (Custom plan with auto-detection) claude-monitor # Alternative commands claude-code-monitor # Full descr
Lo que la gente pregunta sobre Claude-Code-Usage-Monitor
¿Qué es Maciek-roboblog/Claude-Code-Usage-Monitor?
+
Maciek-roboblog/Claude-Code-Usage-Monitor es tools para el ecosistema de Claude AI. Real-time Claude Code usage monitor with predictions and warnings Tiene 7.8k estrellas en GitHub y se actualizó por última vez 7mo ago.
¿Cómo se instala Claude-Code-Usage-Monitor?
+
Puedes instalar Claude-Code-Usage-Monitor clonando el repositorio (https://github.com/Maciek-roboblog/Claude-Code-Usage-Monitor) o siguiendo las instrucciones del README en GitHub. ClaudeWave también te ofrece bloques de instalación rápida en esta misma página.
¿Es seguro usar Maciek-roboblog/Claude-Code-Usage-Monitor?
+
Nuestro agente de seguridad ha analizado Maciek-roboblog/Claude-Code-Usage-Monitor y le ha asignado un Trust Score de 80/100 (tier: Trusted). Revisa el desglose completo de comprobaciones superadas y flags en esta página.
¿Quién mantiene Maciek-roboblog/Claude-Code-Usage-Monitor?
+
Maciek-roboblog/Claude-Code-Usage-Monitor es mantenido por Maciek-roboblog. La última actividad registrada en GitHub es de 7mo ago, con 93 issues abiertos.
¿Hay alternativas a Claude-Code-Usage-Monitor?
+
Sí. En ClaudeWave puedes explorar tools similares en /categories/tools, ordenados por popularidad o actividad reciente.
Despliega Claude-Code-Usage-Monitor en tu cloud
Lleva este repo a producción en minutos. Cada plataforma genera su propio entorno con variables de entorno editables.
¿Mantienes este repo? Añade un badge a tu README
Pega el badge en tu README de GitHub para mostrar que está auditado por ClaudeWave. Cada badge enlaza de vuelta a esta página y muestra el Trust Score actual.
[](https://claudewave.com/repo/maciek-roboblog-claude-code-usage-monitor)<a href="https://claudewave.com/repo/maciek-roboblog-claude-code-usage-monitor"><img src="https://claudewave.com/api/badge/maciek-roboblog-claude-code-usage-monitor" alt="Featured on ClaudeWave — Maciek-roboblog/Claude-Code-Usage-Monitor" width="320" height="64" /></a>Más Tools
Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explaining complex code, and handling git workflows - all through natural language commands.
A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.
An AI SKILL that provide design intelligence for building professional UI/UX multiple platforms
A light-weight and powerful meta-prompting, context engineering and spec-driven development system for Claude Code by TÂCHES.
🪨 why use many token when few token do trick — Claude Code skill that cuts 65% of tokens by talking like caveman
一款 AI 驱动的低代码平台,提供"零代码"与"代码生成"双模式——零代码模式一句话搭建系统,代码生成模式自动输出前后端代码与建表 SQL,生成即可运行。平台内置 AI 聊天助手、AI大模型、知识库、AI流程编排、MCP 与插件体系,兼容主流大模型,支持一句话生成流程图、设计表单、聊天式业务操作,解决 Java 项目 80% 重复工作,高效且不失灵活。