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:
- Primary: Uses the installed
claude-monitorpackage for accurate P90 analysis - 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
- Make sure
claude-monitoris installed:
pip install claude-monitor
- Check if Claude has active sessions:
claude-monitor --plan custom
- 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
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_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
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
491a278265cc1db4240af85796c65abe14b8563b14505a391107f33a7b25193c
|
|
| MD5 |
d33ed06b6d21a6bf663b661e47d610c2
|
|
| BLAKE2b-256 |
892b52dc91008c44b147325cb82d973de34bb34a17c62fb864b29c801fe9c73d
|
File details
Details for the file claude_statusbar-1.0.0-py3-none-any.whl.
File metadata
- Download URL: claude_statusbar-1.0.0-py3-none-any.whl
- Upload date:
- Size: 9.6 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/6.1.0 CPython/3.13.5
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
29be5a46a7d89cbf6ad5445a7bb0b3fe503663a4853054f28b757f54d7b61ce5
|
|
| MD5 |
2af4beabdad08e2ee78877b388a2626a
|
|
| BLAKE2b-256 |
8a25e4e364ac90ad3d52561e8fb90f84b83133db562ab8a145d2a1b35f1ca91a
|