A lightweight macOS menu bar app that tracks your Claude Code API usage in real-time.
- π Real-time Usage Tracking - Monitor your Claude Code API usage with automatic 30-second updates
- π― Menu Bar Integration - Glanceable usage percentage directly in your menu bar
- β° Reset Timer - See when your 5-hour usage window resets
- π Secure Authentication - Uses your existing Claude Code credentials from Keychain
- π¨ Native macOS Design - Clean, modern SwiftUI interface
Screenshots can be found here:
- https://share.cleanshot.com/Hr7wz1l1jmhk30V0Y0NS
- https://share.cleanshot.com/J3KlDzq0rPc8sWS4tq0b
- https://share.cleanshot.com/XlGCXvYGmYr21Tr4Zhrh
- macOS 12.0 or later
- Claude Code installed and authenticated
- Xcode 15.0+ (for building from source)
- Go to the Releases page
- Download the latest
AI-Resource-Tracker.app.zip - Unzip the file
- Move
AI Resource Tracker.appto your Applications folder - Right-click the app and select "Open" (required for first launch due to Gatekeeper)
-
Clone this repository:
git clone https://github.com/YOUR_USERNAME/ai-resource-tracker.git cd ai-resource-tracker -
Open the project in Xcode:
open AI\ resource\ tracker.xcodeproj
-
Select your signing team in Xcode:
- Select the project in the navigator
- Go to "Signing & Capabilities"
- Select your team from the dropdown
-
Build and run (βR)
-
First Launch: If you haven't signed in to Claude Code yet:
- Open Terminal
- Run
claudecommand - Complete the OAuth authentication
- Restart AI Resource Tracker
-
Normal Use:
- The app shows your usage percentage in the menu bar
- Click the menu bar icon to see detailed information:
- Current usage percentage
- Time until usage window resets
- Detailed usage breakdown
-
Launch at Login (Optional):
- Click the menu bar icon
- Select "Open at Login..."
- Enable the app in Login Items settings
-
Quit: Click the menu bar icon and select "Quit"
AI Resource Tracker integrates with Claude Code's authentication system:
- Reads your OAuth credentials from macOS Keychain (service:
Claude Code-credentials) - Reads your organization ID from
~/.claude.json - Uses the Anthropic OAuth API to fetch usage data
- Displays your 5-hour usage window utilization
- β All credentials are stored securely in macOS Keychain
- β No data is collected or sent to third parties
- β API calls go directly to Anthropic's servers
- β Open source - you can audit the code yourself
To create a distributable build:
# Build release version
xcodebuild -project "AI resource tracker.xcodeproj" \
-scheme "AI resource tracker" \
-configuration Release \
-derivedDataPath ./build
# Find the built app
open build/Build/Products/Release/-
Archive the app:
- In Xcode: Product β Archive
- Wait for the build to complete
-
Export the app:
- Click "Distribute App"
- Select "Copy App"
- Choose a destination folder
-
Sign the app (if you have a Developer ID):
codesign --deep --force --verify --verbose \ --sign "Developer ID Application: YOUR NAME (TEAM_ID)" \ "AI Resource Tracker.app" -
Notarize the app (optional, requires paid Apple Developer account):
# Create a zip ditto -c -k --keepParent "AI Resource Tracker.app" "AI-Resource-Tracker.zip" # Submit for notarization xcrun notarytool submit AI-Resource-Tracker.zip \ --apple-id "your@email.com" \ --team-id "YOUR_TEAM_ID" \ --password "app-specific-password" \ --wait # Staple the notarization ticket xcrun stapler staple "AI Resource Tracker.app"
-
Create release zip:
ditto -c -k --keepParent "AI Resource Tracker.app" "AI-Resource-Tracker-v1.0.zip"
-
Upload to GitHub Releases:
- Go to your repository on GitHub
- Click "Releases" β "Create a new release"
- Add a tag (e.g.,
v1.0.0) - Upload the zip file
- Write release notes
Create .github/workflows/release.yml for automated builds on tag push.
AI resource tracker/
βββ AI_resource_trackerApp.swift # App entry point
βββ PopoverView.swift # Main UI
βββ AuthManager.swift # Authentication handling
βββ UsageViewModel.swift # Data management
βββ ClaudeCodeProviderFinal.swift # API integration
βββ UsageProvider.swift # Protocol definitions
To add support for other AI services:
- Create a new class conforming to
UsageProvider - Implement the required properties and
fetchUsage()method - Add the provider in
UsageViewModel.configure()
Example:
final class NewAIProvider: UsageProvider {
let id = "new-ai"
let name = "New AI Service"
let refreshInterval: TimeInterval = 60
func fetchUsage() async -> UsageData? {
// Implement API call
}
}App shows "Not Signed In"
- Make sure Claude Code is installed and you've run
claudeat least once - Try running
claudein Terminal to refresh authentication - Restart the AI Resource Tracker app
No usage data showing
- Check that you have an active Claude Code subscription
- Ensure you have internet connectivity
- Check Console.app for error messages (filter for "AI resource tracker")
App won't open (Gatekeeper)
- Right-click the app and select "Open"
- Or: System Settings β Privacy & Security β Allow anyway
Contributions are welcome! Feel free to:
- Report bugs via Issues
- Suggest features via Issues
- Submit Pull Requests
This project is licensed under the MIT License - see the LICENSE file for details.
- Built with SwiftUI and Swift Concurrency
- Uses the Anthropic OAuth API
- Inspired by the need to track AI usage limits
This is an unofficial app and is not affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic, PBC.
Made with β€οΈ by Reind Dooyeweerd