Repository navigation
v18.2.0
ccusage v18.2.0 - Automated Background Sync
✨ Major New Feature: Automated Background Synchronization
Never manually run blocks-monitor again! This release introduces automated background sync that keeps your usage data synchronized across all machines without any manual intervention.
🚀 New Features
sync Command
- One-shot sync: New
ccusage synccommand submits current token usage and exits - Perfect for automation: Designed for cron jobs and system services
- Silent operation:
--quietflag suppresses all output for background usage - Replaces manual monitoring: No need to keep terminals open with
blocks-monitor
System Service Files
Ready-to-use service configurations for automatic synchronization every 5 minutes:
Linux (systemd):
ccusage-sync.service- Service unit that runs the sync commandccusage-sync.timer- Timer unit for 5-minute intervals- Security hardened with read-only filesystem access
macOS (launchd):
com.ccusage.sync.plist- LaunchAgent for background sync- Starts automatically on login
- Logs to
/tmp/ccusage-sync.log
Installation Helpers
install-macos-service.sh- Automated installer for macOStest-macos-service.sh- Service verification tool- Comprehensive documentation in
system-services/README.md
🐛 Bug Fixes
- Fixed live monitor burn rate calculation to exclude cache tokens (merged from upstream)
- Burn rate indicators now only consider input/output tokens for accurate HIGH/MODERATE/NORMAL thresholds
📦 Installation
Download the appropriate binary for your platform:
- Linux x64:
ccusage-linux-x64.tar.gz - macOS x64 (Intel):
ccusage-macos-x64.tar.gz - macOS ARM64 (Apple Silicon):
ccusage-macos-arm64.tar.gz
🔄 Quick Setup for Background Sync
macOS:
tar -xzf ccusage-macos-arm64.tar.gz
./install-macos-service.shLinux:
tar -xzf ccusage-linux-x64.tar.gz
sudo cp ccusage-linux-x64 /usr/local/bin/ccusage
sudo cp system-services/ccusage-sync.* /etc/systemd/user/
systemctl --user enable --now ccusage-sync.timer📊 How It Works
- The
synccommand reads your current Claude usage data - Submits it to the ccusage server (soothaa.pythonanywhere.com)
- Exits immediately - perfect for scheduled tasks
- Runs every 5 minutes via system services
- Your usage data stays synchronized across all machines automatically
🔧 Manual Usage
You can still run sync manually:
ccusage sync # Submit usage and show summary
ccusage sync --quiet # Submit silently (for scripts)📝 Full Changelog
- Added
synccommand for one-shot token submission - Created systemd service + timer for Linux
- Created launchd plist for macOS
- Added installation and test scripts
- Updated dependencies from upstream
- Fixed burn rate calculation in live monitor
- Enhanced documentation with service setup instructions
🙏 Credits
Thanks to @ryoppippi for the original ccusage project and the upstream fixes!