Skip to main content

Lightweight status bar monitor for Claude AI token usage

Project description

Claude Status Bar Monitor

A lightweight status bar monitor for Claude AI token usage. This tool displays real-time usage statistics in your terminal status bar.

Features

  • 🔋 Real-time token usage tracking
  • 💰 Cost monitoring
  • ⏱️ Session reset timer
  • 🎨 Color-coded usage indicators (green/yellow/red)
  • 📊 Automatic P90 limit detection
  • 🚀 Lightweight and fast
  • 📦 Available as PyPI package
  • 🔧 One-line web installation

Quick Installation

🚀 One-Line Web Install (Easiest)

curl -fsSL https://raw.githubusercontent.com/leeguooooo/claude-code-usage-bar/main/web-install.sh | bash

Or with wget:

wget -qO- https://raw.githubusercontent.com/leeguooooo/claude-code-usage-bar/main/web-install.sh | bash

📦 Install from PyPI

# Using uv (recommended - fastest)
uv tool install claude-statusbar

# Or using pip
pip install claude-statusbar

# Or using pipx (isolated environment)
pipx install claude-statusbar

After installation, run from anywhere:

claude-statusbar  # Full command
cstatus          # Short alias
cs               # Shortest alias

🔨 Install from Source

# Clone and install
git clone https://github.com/leeguooooo/claude-code-usage-bar.git
cd claude-code-usage-bar
pip install -e .

# Or use the local installer
./install.sh

Usage

Basic Usage

Run the script directly:

./statusbar.py

Output example:

🔋 T:15.2k/88k | $:12.50/35 | ⏛2h 35m | Usage:17%

Integration with tmux

Add to your ~/.tmux.conf:

set -g status-right '#(~/path/to/claude-statusbar-monitor/statusbar.py)'
set -g status-interval 10

Integration with Zsh (Oh My Zsh)

Add to your ~/.zshrc:

# Claude usage in prompt
claude_usage() {
    ~/path/to/claude-statusbar-monitor/statusbar.py
}
RPROMPT='$(claude_usage)'

Integration with i3 status bar

Add to your i3 config:

bar {
    status_command while :; do echo "$(~/path/to/claude-statusbar-monitor/statusbar.py)"; sleep 10; done
}

How It Works

The monitor has two data sources:

  1. Primary: Uses the installed claude-monitor package for accurate P90 analysis
  2. Fallback: Direct file analysis if the package is not available

Status Indicators

  • T: Token usage (current/limit)
  • $: Cost in USD (current/limit)
  • ⏱️: Time until session reset
  • Usage %: Color-coded percentage
    • 🟢 Green: < 30%
    • 🟡 Yellow: 30-70%
    • 🔴 Red: > 70%

Troubleshooting

No data showing

  1. Make sure claude-monitor is installed:
pip install claude-monitor
  1. Check if Claude has active sessions:
claude-monitor --plan custom
  1. Verify the script has execution permissions:
chmod +x statusbar.py

Wrong timezone

The monitor automatically detects your timezone. If incorrect, set it manually in your environment:

export TZ='America/New_York'

Uninstallation

To remove the status bar monitor and clean up aliases:

./uninstall.sh

This will:

  • Remove shell aliases from your configuration files
  • Optionally uninstall the claude-monitor package
  • Keep the project files (you can delete them manually if needed)

License

MIT

Credits

Built on top of Claude Code Usage Monitor by @Maciek-roboblog

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_statusbar-1.0.0.tar.gz (10.4 kB view details)

Uploaded Source

Built Distribution

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

claude_statusbar-1.0.0-py3-none-any.whl (9.6 kB view details)

Uploaded Python 3

File details

Details for the file claude_statusbar-1.0.0.tar.gz.

File metadata

  • Download URL: claude_statusbar-1.0.0.tar.gz
  • Upload date:
  • Size: 10.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.5

File hashes

Hashes for claude_statusbar-1.0.0.tar.gz
Algorithm Hash digest
SHA256 491a278265cc1db4240af85796c65abe14b8563b14505a391107f33a7b25193c
MD5 d33ed06b6d21a6bf663b661e47d610c2
BLAKE2b-256 892b52dc91008c44b147325cb82d973de34bb34a17c62fb864b29c801fe9c73d

See more details on using hashes here.

File details

Details for the file claude_statusbar-1.0.0-py3-none-any.whl.

File metadata

File hashes

Hashes for claude_statusbar-1.0.0-py3-none-any.whl
Algorithm Hash digest
SHA256 29be5a46a7d89cbf6ad5445a7bb0b3fe503663a4853054f28b757f54d7b61ce5
MD5 2af4beabdad08e2ee78877b388a2626a
BLAKE2b-256 8a25e4e364ac90ad3d52561e8fb90f84b83133db562ab8a145d2a1b35f1ca91a

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