Monitor Claude AI token usage with zero dependencies
Project description
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
pip install claude-usage-cli
Quick Start
# Default monitoring (Pro plan)
claude-usage-cli
# Monitor with Max5 plan
claude-usage-cli --plan max5
# Custom timezone and reset hour
claude-usage-cli --plan max20 --timezone US/Eastern --reset-hour 9
# 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 --reset-hour 10 # Set reset hour
claude-usage-cli --refresh 5 # Set refresh interval
claude-usage-cli --no-color # Disable colors
Plans Supported
- Pro: 40 conversations per 5 hours, 200 daily
- Max5: 5 conversations per 5 hours, 30 daily
- Max20: 20 conversations per 5 hours, 100 daily
- Custom: Configurable limits
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 into 5-hour billing windows
- 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 <repository-url>
cd claude-usage-cli/python
# Install in development mode
pip install -e .
# Run directly
python -m claude_monitor.cli --help
License
MIT License - see LICENSE file for details.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file claude_usage_cli-1.1.2.tar.gz.
File metadata
- Download URL: claude_usage_cli-1.1.2.tar.gz
- Upload date:
- Size: 21.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
2bbb506a969800a73ca55e0f842b260177856d932c12c09596ff9e89f990a5e4
|
|
| MD5 |
072bbc81f27d01e7878702ce1ec94ac1
|
|
| BLAKE2b-256 |
1eed7950885bc5d71090466996ac939ee74fb467fd4a8cf16e7c4f7532e9e04c
|
File details
Details for the file claude_usage_cli-1.1.2-py3-none-any.whl.
File metadata
- Download URL: claude_usage_cli-1.1.2-py3-none-any.whl
- Upload date:
- Size: 23.2 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.11.13
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
af37a9c874751bef5a223c79a01cb0b7cdd19a2ceab7e184dfcc93866a667043
|
|
| MD5 |
f2c6fedd14d0f959e42ef7df9f4dd7f4
|
|
| BLAKE2b-256 |
002f8bf6b2cd11141e9a45043e0914f8dac97681c9823037680cccc067b02fbf
|