Skip to content

utajum/claude-usage

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

29 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Linux System Tray

Screenshot

Windows System Tray

Windows Screenshot


                                                   
  β–‘β–ˆβ–€β–€β–‘β–ˆβ–‘β–‘β–‘β–ˆβ–€β–ˆβ–‘β–ˆβ–‘β–ˆβ–‘β–ˆβ–€β–„β–‘β–ˆβ–€β–€β–‘β–‘β–‘β–ˆβ–‘β–ˆβ–‘β–ˆβ–€β–€β–‘β–ˆβ–€β–ˆβ–‘β–ˆβ–€β–€β–‘β–ˆβ–€β–€
  β–‘β–ˆβ–‘β–‘β–‘β–ˆβ–‘β–‘β–‘β–ˆβ–€β–ˆβ–‘β–ˆβ–‘β–ˆβ–‘β–ˆβ–‘β–ˆβ–‘β–ˆβ–€β–€β–‘β–‘β–‘β–ˆβ–‘β–ˆβ–‘β–€β–€β–ˆβ–‘β–ˆβ–€β–ˆβ–‘β–ˆβ–‘β–ˆβ–‘β–ˆβ–€β–€
  β–‘β–€β–€β–€β–‘β–€β–€β–€β–‘β–€β–‘β–€β–‘β–€β–€β–€β–‘β–€β–€β–‘β–‘β–€β–€β–€β–‘β–‘β–‘β–€β–€β–€β–‘β–€β–€β–€β–‘β–€β–‘β–€β–‘β–€β–€β–€β–‘β–€β–€β–€
          ╔═══════════════════════════════╗
          β•‘  SYSTEM TRAY USAGE MONITOR    β•‘
          β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

> ESTABLISHING NEURAL UPLINK TO ANTHROPIC SERVERS...

> CONNECTION SECURED :: MONITORING ACTIVE

πŸ”₯ Watch your tokens burn in real-time. Your wallet weeps silently. πŸ”₯

Buy Me A Coffee

Project Page: https://claude-usage.elevatech.xyz


β–‘β–’β–“β–ˆ 0x00 :: SYSTEM OVERVIEW β–ˆβ–“β–’β–‘

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                                             β”‚
β”‚   Claude Usage is a system tray application that monitors your             β”‚
β”‚   Claude Code API consumption. Tracks token burn rate across models.       β”‚
β”‚                                                                             β”‚
β”‚   > No browser required                                                     β”‚
β”‚   > Real-time progress bars                                                 β”‚
β”‚   > Multi-model breakdown (Opus, Sonnet)                                    β”‚
β”‚   > Reset countdown timers                                                  β”‚
β”‚   > Works on Linux, Windows, macOS                                          β”‚
β”‚                                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β–‘β–’β–“β–ˆ 0x01 :: PLATFORM COMPATIBILITY MATRIX β–ˆβ–“β–’β–‘

> SCANNING TARGET ARCHITECTURES...
> [OK] COMPATIBILITY CHECK COMPLETE
PLATFORM ARCH STATUS PACKAGE
Windows x64 [SUPPORTED] claude-usage-windows-amd64.zip
macOS Universal [SUPPORTED] Claude-Usage-*.dmg
macOS Intel [SUPPORTED] claude-usage-darwin-amd64
macOS Apple Silicon [SUPPORTED] claude-usage-darwin-arm64
Linux x64 [SUPPORTED] claude-usage-linux-amd64
Linux ARM64 [SUPPORTED] claude-usage-linux-arm64
> DESKTOP ENVIRONMENT SCAN:
  β”œβ”€ [OK] KDE Plasma
  β”œβ”€ [OK] GNOME (requires AppIndicator extension)
  β”œβ”€ [OK] XFCE
  β”œβ”€ [OK] Cinnamon
  β”œβ”€ [OK] MATE
  β”œβ”€ [OK] Budgie
  └─ [OK] Any DE supporting StatusNotifierItem

β–‘β–’β–“β–ˆ 0x02 :: DEPLOYMENT PROTOCOLS β–ˆβ–“β–’β–‘

╔══════════════════════════════════════════════════════════════════════════════╗
β•‘  > BINARY PACKAGES AVAILABLE AT:                                             β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

https://github.com/utajum/claude-usage/releases


Windows > TARGET: WINDOWS_x64

1. Download claude-usage-windows-amd64.zip from releases
2. Extract the ZIP file
3. Right-click install-windows.ps1 β†’ "Run with PowerShell"
4. Find "Claude Usage" in Start Menu

Manual Installation:

# Or run from PowerShell directly:
powershell -ExecutionPolicy Bypass -File install-windows.ps1

# To uninstall:
powershell -ExecutionPolicy Bypass -File install-windows.ps1 -Uninstall

What gets installed:

  • %LOCALAPPDATA%\Programs\claude-usage\claude-usage.exe
  • Start Menu shortcut
  • Startup shortcut (autostart on login)

macOS > TARGET: MACOS (Universal)

# Option 1: Download DMG (recommended)
1. Download Claude-Usage-*.dmg from releases
2. Open the DMG file
3. Drag "Claude Usage" to Applications folder
4. Right-click β†’ Open (first time only, to bypass Gatekeeper)
# Option 2: Command line install
curl -sL https://github.com/utajum/claude-usage/releases/latest/download/claude-usage-darwin-arm64 -o claude-usage
chmod +x claude-usage
./claude-usage

Enable autostart:

# Copy the LaunchAgent plist (from source repo)
cp assets/macos/com.github.utajum.claude-usage.plist ~/Library/LaunchAgents/
launchctl load ~/Library/LaunchAgents/com.github.utajum.claude-usage.plist

Linux > TARGET: LINUX (x64/ARM64)

One-liner install (recommended):

curl -sL https://raw.githubusercontent.com/utajum/claude-usage/master/scripts/install-linux.sh | bash

This automatically:

  • Detects your architecture (x64 or ARM64)
  • Downloads the latest release
  • Installs to ~/.local/bin/
  • Creates desktop entry (shows in applications menu)
  • Enables autostart on login

Install options:

# Install without autostart
curl -sL https://raw.githubusercontent.com/utajum/claude-usage/master/scripts/install-linux.sh | bash -s -- --no-autostart

# Install without desktop entry
curl -sL https://raw.githubusercontent.com/utajum/claude-usage/master/scripts/install-linux.sh | bash -s -- --no-desktop

# Uninstall
curl -sL https://raw.githubusercontent.com/utajum/claude-usage/master/scripts/install-linux.sh | bash -s -- --uninstall

Manual download:

# x64
curl -sL https://github.com/utajum/claude-usage/releases/latest/download/claude-usage-linux-amd64 -o claude-usage

# ARM64
curl -sL https://github.com/utajum/claude-usage/releases/latest/download/claude-usage-linux-arm64 -o claude-usage

chmod +x claude-usage
./claude-usage

Build from source:

git clone https://github.com/utajum/claude-usage
cd claude-usage
make install-linux    # Full install with desktop integration
# or
make install          # Binary only

OpenCode Support:

Claude Usage also supports OpenCode credentials on Linux:

  • Right-click the tray icon and click "Source: Claude Code" to toggle to OpenCode
  • Credentials are read from ~/.local/share/opencode/auth.json
  • The app auto-detects available sources on first run
  • If only OpenCode credentials exist, it will be used by default

β–‘β–’β–“β–ˆ 0x03 :: NEURAL INTERFACE β–ˆβ–“β–’β–‘

> HOVER OVER TRAY ICON TO ACCESS TELEMETRY FEED

Tooltip displays real-time consumption data:

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚ CLAUDE USAGE                       β”‚
β”‚ Plan: Pro (5x)                     β”‚
β”‚ STATUS: THROTTLED                  β”‚
β”‚ β–•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–  80% 2h 15m β—€         β”‚
β”‚ β–•β–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–ˆβ–‘β–‘β–‘β–‘β–  60% 3d 5h            β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

LEGEND:
β”œβ”€ First bar  :: 5-hour rolling window
β”œβ”€ Second bar :: Weekly allocation
β”œβ”€ β—€ marker   :: Active rate limiter
└─ Time       :: Reset countdown

β–‘β–’β–“β–ˆ 0x04 :: DATA STREAM SOURCES β–ˆβ–“β–’β–‘

> SCANNING LOCAL FILESYSTEM FOR CLAUDE CREDENTIALS...

The app reads your Claude Code credentials to fetch real-time rate limit data from the API:

OS CREDENTIALS FILE
Linux ~/.claude/.credentials.json
macOS ~/.claude/.credentials.json
Windows C:\Users\<username>\.claude\.credentials.json
> DATA FLOW:
  β”œβ”€ [1] Read OAuth token from .credentials.json
  β”œβ”€ [2] Call Anthropic API for real-time rate limits
  └─ [3] Display usage % and reset timers

> PREREQUISITES:
  β”œβ”€ [REQUIRED] Claude Code CLI installed and logged in
  └─ [REQUIRED] Valid credentials file with OAuth token

Note: The stats-cache.json file is only used as a fallback when API data is unavailable.


β–‘β–’β–“β–ˆ 0x05 :: COMPILE FROM SOURCE β–ˆβ–“β–’β–‘

> INITIATING BUILD SEQUENCE...
# Clone repository
git clone https://github.com/utajum/claude-usage
cd claude-usage

# Build for current platform
make build

# Or cross-compile for all targets
make build-all

# Generate icon assets
make generate-icons

# Platform-specific packaging
make build-macos-app  # Creates .app bundle (macOS only)

> BUILD REQUIREMENTS

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚  DEPENDENCY          VERSION        STATUS                                  β”‚
β”œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€
β”‚  Go                  1.22+          [REQUIRED]                              β”‚
β”‚  CGO                 enabled        [REQUIRED for macOS/Windows]            β”‚
β”‚  UPX                 4.0+           [REQUIRED for optimized builds]         β”‚
β”‚  External libs       none           [PURE GO BUILD on Linux]                β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β–‘β–’β–“β–ˆ 0x06 :: SYSTEM CONFIGURATION β–ˆβ–“β–’β–‘

> LOADING CONFIG PARAMETERS...

Config file locations:

OS CONFIG_PATH
Linux ~/.config/claude-usage/config.json
macOS ~/Library/Application Support/claude-usage/config.json
Windows %APPDATA%\claude-usage\config.json
{
  "refresh_interval_seconds": 300
}
> DEFAULT REFRESH RATE: 300 seconds (5 minutes)

β–‘β–’β–“β–ˆ 0x07 :: PERSISTENCE PROTOCOLS β–ˆβ–“β–’β–‘

Linux > AUTOSTART

make autostart          # Enable persistence
make autostart-remove   # Disable persistence

Windows > AUTOSTART

The installer automatically creates a Startup shortcut. To manage manually:

Location: %APPDATA%\Microsoft\Windows\Start Menu\Programs\Startup\Claude Usage.lnk

macOS > AUTOSTART

# Enable
launchctl load ~/Library/LaunchAgents/com.github.utajum.claude-usage.plist

# Disable  
launchctl unload ~/Library/LaunchAgents/com.github.utajum.claude-usage.plist

Or via System Settings β†’ General β†’ Login Items


β–‘β–’β–“β–ˆ 0x08 :: CORE LOGIC FLOW β–ˆβ–“β–’β–‘

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                                             β”‚
β”‚   [1] READ    ──► Parse ~/.claude/stats-cache.json                          β”‚
β”‚                                                                             β”‚
β”‚   [2] PROCESS ──► Calculate token consumption per model                     β”‚
β”‚                                                                             β”‚
β”‚   [3] COMPUTE ──► Aggregate weekly totals (Monday-Sunday cycle)             β”‚
β”‚                                                                             β”‚
β”‚   [4] RENDER  ──► Generate dynamic tray icon based on usage %               β”‚
β”‚                                                                             β”‚
β”‚   [5] DISPLAY ──► System tray with hover tooltip                            β”‚
β”‚                                                                             β”‚
β”‚   [6] LOOP    ──► Auto-refresh every 5 minutes                              β”‚
β”‚                                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β–‘β–’β–“β–ˆ 0x09 :: DIAGNOSTICS β–ˆβ–“β–’β–‘

> ERROR: ICON_NOT_VISIBLE

LINUX:
β”œβ”€ Verify DE supports StatusNotifierItem
β”œβ”€ GNOME: Install AppIndicator extension
└─ Check system tray is enabled

WINDOWS:
β”œβ”€ Check system tray overflow area (click ^ arrow)
β”œβ”€ Right-click taskbar β†’ Taskbar settings β†’ System tray icons
└─ Enable "Claude Usage" to always show

MACOS:
β”œβ”€ Check menu bar (may be hidden by notch on newer Macs)
└─ Try Bartender or similar app to manage menu bar items

ALL PLATFORMS:
└─ Confirm Claude Code is installed and operational

> ERROR: NO_DATA_AVAILABLE

β”œβ”€ Execute 'claude' command at least once
β”œβ”€ Verify ~/.claude/stats-cache.json exists
└─ Check file permissions

β–‘β–’β–“β–ˆ 0x0A :: MAKE TARGETS β–ˆβ–“β–’β–‘

make help  # Show all available targets
Development:
  make build          - Build optimized (stripped + UPX, ~5MB)
  make build-fast     - Build stripped only, no UPX (~7.5MB)
  make build-debug    - Build with debug symbols (~12MB)
  make run            - Build and run
  make test           - Run tests
  make generate-icons - Generate icon assets

Installation (Linux):
  make install        - Install binary to ~/.local/bin
  make install-linux  - Full install (binary + desktop + autostart)
  make desktop-install- Install desktop entry (app menu)
  make autostart      - Enable autostart on login
  make uninstall      - Remove everything

Installation (macOS):
  make install-macos  - Install .app bundle + autostart
  make uninstall-macos- Remove app and autostart

Cross-compilation:
  make build-linux    - Build for Linux (amd64, arm64)
  make build-windows  - Build for Windows (amd64)
  make build-macos    - Build for macOS (Intel, Apple Silicon)
  make build-macos-app- Build macOS .app bundle
  make build-all      - Build for all platforms

β–‘β–’β–“β–ˆ 0x0B :: SUPPORT THE GRID β–ˆβ–“β–’β–‘

> INITIATING DONATION PROTOCOL...
> CAFFEINE LEVELS: CRITICALLY LOW

Buy Me A Coffee

β”Œβ”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”
β”‚                                                                             β”‚
β”‚   If this tool saved you from rate limit anxiety, consider fueling         β”‚
β”‚   the development with some caffeinated tokens.                             β”‚
β”‚                                                                             β”‚
β”‚   > Every coffee = More features                                            β”‚
β”‚   > Every coffee = Faster bug fixes                                         β”‚
β”‚   > Every coffee = Developer happiness++                                    β”‚
β”‚                                                                             β”‚
β””β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”€β”˜

β–‘β–’β–“β–ˆ 0x0C :: LICENSE β–ˆβ–“β–’β–‘

MIT License

Permission granted to copy, modify, distribute.
No warranty. Use at your own risk.

╔══════════════════════════════════════════════════════════════════════════════╗
β•‘                                                                              β•‘
β•‘   β–‘β–’β–“β–ˆ CONNECTION TERMINATED :: END OF TRANSMISSION β–ˆβ–“β–’β–‘                     β•‘
β•‘                                                                              β•‘
β•‘   > Stay connected to the grid                                               β•‘
β•‘   > Monitor your burn rate                                                   β•‘
β•‘   > Trust no one. Especially your token consumption.                         β•‘
β•‘                                                                              β•‘
β•šβ•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•β•

Project Page: https://claude-usage.elevatech.xyz

> SESSION_END :: 0x00000000

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Packages

 
 
 

Contributors