Claude Usage Monitor (Python Package)
Professional CLI tool for monitoring Claude AI token usage with zero external dependencies.
Credits & Attribution
This package is based on the original Claude-Code-Usage-Monitor by Maciej (maciek@roboblog.eu). This version transforms it into a zero-dependency pip-installable package while maintaining all original functionality.
Installation
# Run without installing anything (recommended)
uvx claude-usage-cli
# Or install it
uv tool install claude-usage-cli
pip install claude-usage-cli
The package has zero dependencies, so uvx fetches and runs it in one step
with no virtualenv to manage:
uvx claude-usage-cli --summary
uvx claude-usage-cli --plan max20 --weekly-limit 4000
Quick Start
# Default monitoring (Pro plan)
claude-usage-cli
# Monitor with Max5 plan
claude-usage-cli --plan max5
# Custom timezone
claude-usage-cli --plan max20 --timezone US/Eastern
# Track against your own weekly limit
claude-usage-cli --weekly-limit 2000
# Show help
claude-usage-cli --help
Features
- 📊 Real-time token monitoring with visual progress bars
- 🔮 Smart predictions based on usage patterns
- 🎯 Multi-plan support (Pro, Max5, Max20, Custom)
- 🌍 Timezone handling for accurate reset times
- 🎨 Beautiful terminal UI with colors and emojis
- ⚡ Zero external dependencies - completely self-contained
- 🔄 Auto-refresh every 3 seconds
- 📱 Cross-platform (Windows, macOS, Linux)
Commands
# Basic usage
claude-usage-cli # Start monitoring with Pro plan
claude-usage-cli --plan max5 # Monitor with Max5 plan
claude-usage-cli --once # Run once and exit
claude-usage-cli --summary # Show summary only
# Configuration
claude-usage-cli --list-plans # Show available plans
claude-usage-cli --list-timezones # Show timezone options
claude-usage-cli --info # Show configuration info
# Customization
claude-usage-cli --timezone US/Pacific # Set timezone
claude-usage-cli --limit-per-5h 60 # Override the 5-hour estimate
claude-usage-cli --weekly-limit 2000 # Track against your own weekly limit
claude-usage-cli --refresh 5 # Set refresh interval
claude-usage-cli --no-color # Disable colors
Limits
Claude enforces two limits, and neither of them is a daily limit:
| Window | How it works |
|---|---|
| 5-hour session | Opens at your first message and runs for five hours. |
| Weekly | Resets seven days after your first message of the week. |
Releases up to 1.1.2 displayed a daily limit instead of the weekly one. It did not correspond to anything Claude enforces, and the per-plan numbers behind it were invented. Both are fixed in 1.2.0.
Plans supported
| Plan | 5-hour estimate | Weekly |
|---|---|---|
pro |
~45 messages | set with --weekly-limit |
max5 |
~225 messages | set with --weekly-limit |
max20 |
~900 messages | set with --weekly-limit |
custom |
set with --limit-per-5h |
set with --weekly-limit |
The 5-hour figures are Anthropic's published estimates for average-length
chats; real capacity moves with message size, context length, attachments and
model, so the output labels them est.. Override with --limit-per-5h.
Weekly limits have no default on purpose. Anthropic publishes them as ranges
of model hours, not as a message count, so there is no honest conversion
into the message counter this tool keeps. Without --weekly-limit the weekly
section still reports real usage — messages, tokens, sessions, burn rate and
when your oldest activity rolls off — just without a percentage bar. Supply
--weekly-limit N once you know where yours actually bites and you get the
bar and a projection.
How It Works
This package reads Claude's conversation logs directly from your local filesystem:
- Location:
~/.config/claude/projects/(Unix) or%APPDATA%\claude\(Windows) - Format: JSONL files containing conversation data
- Processing: Extracts token usage and groups it into 5-hour session windows anchored to your first message (not to fixed slices of the clock)
- Predictions: Analyzes usage patterns to predict future consumption
Zero Dependencies
This package uses only Python's built-in libraries:
datetimefor timezone handling (no pytz needed)jsonfor parsing JSONL filesargparsefor CLI interfaceos/sysfor system operations
Requirements
- Python 3.7+
- Claude Desktop installed and used at least once
- Access to Claude's local data directory
Development
# Clone repository
git clone https://github.com/jedarden/claude-usage-monitor-cli.git
cd claude-usage-monitor-cli/python
# Install in development mode
pip install -e .
# Run the test suite (stdlib unittest, no dependencies)
python -m unittest discover -s tests -v
# Run directly
python -m claude_monitor.cli --help
License
MIT License - see LICENSE file for details.
Metadata
Release files for claude-usage-cli 1.2.0
For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.
Source distribution (sdist)
| File | Size | Uploaded | |
|---|---|---|---|
| claude_usage_cli-1.2.0.tar.gz | 29.4 kB | Details |
Built distribution (wheel)
| File | Interpreter | ABI | Platform | Reset |
|---|---|---|---|---|
| claude_usage_cli-1.2.0-py3-none-any.whl | Python 3 | none | any | Details |
Total release size: 55.9 kB
Release files / claude_usage_cli-1.2.0.tar.gz
| Download URL | claude_usage_cli-1.2.0.tar.gz |
|---|---|
| Size | 29.4 kB |
| Tags | Source |
|
SHA-256 checksum How to use checksums |
144587762a19b5bbd9cba230a49de0ee3cc974f64b0831d3d22a36494552e4f1
|
|
BLAKE2b-256 checksum How to use checksums |
fff729229fc5c94d4875efda413f69e6f2c84cb64eaa444dcf7945c58902a1af
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|
Release files / claude_usage_cli-1.2.0-py3-none-any.whl
| Download URL | claude_usage_cli-1.2.0-py3-none-any.whl |
|---|---|
| Size | 26.5 kB |
| Tags | Python 3 |
|
SHA-256 checksum How to use checksums |
890a0b1278a1ec783fd7a26c482c5afa3b3ac251a3a60f766e6d3c3d955b6350
|
|
BLAKE2b-256 checksum How to use checksums |
9faed3f144b2fcfdaaace0904e68075bb2e5464e727d2ad160feba6373c12449
|
| Upload date | |
|
Uploaded using Trusted Publishing? What is trusted publishing? |
No |
| Uploaded via |
twine/7.0.0 CPython/3.14.6
|