Skip to main content

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:

  • datetime for timezone handling (no pytz needed)
  • json for parsing JSONL files
  • argparse for CLI interface
  • os/sys for 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


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

claude_usage_cli-1.1.1.tar.gz (21.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

claude_usage_cli-1.1.1-py3-none-any.whl (23.2 kB view details)

Uploaded Python 3

File details

Details for the file claude_usage_cli-1.1.1.tar.gz.

File metadata

  • Download URL: claude_usage_cli-1.1.1.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

Hashes for claude_usage_cli-1.1.1.tar.gz
Algorithm Hash digest
SHA256 d9e14018e46286e2da1fe61a39d5277e517bf6ab670e86c039c9b03576b6d2e8
MD5 1bc6b47fc40c6d18b16b85a460f3341a
BLAKE2b-256 b15a28874bd3809b466b73b9ed1d54f72d35a98722aaa59ad63bac416c66aea1

See more details on using hashes here.

File details

Details for the file claude_usage_cli-1.1.1-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_usage_cli-1.1.1-py3-none-any.whl
Algorithm Hash digest
SHA256 283b541dd38ce577a8fc8bba7dcc0ef08c847089f26fd4beebae2c540da3f5cc
MD5 126c54e765bf34cf8b0b51c37c3f3dcc
BLAKE2b-256 9d3932452a587c2ecd1db2ac090523fe31df87ebc46216b85f9c2c354b07ffda

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