AI Usage Menu is free software under the MIT license. The Swift provider readers, build script and parser tests show how the app gets each reading onto your Mac. Inspect the code that touches your data, build the app yourself or contribute support for another provider.
Creates the updater that checks at launch and once a day.
private func updater() -> SPUUpdater { if let controller { return controller.updater } let made = SPUStandardUpdaterController(startingUpdater: true, updaterDelegate: self, userDriverDelegate: nil) controller = made return made.updater } /// Turns the daily check on or off. On: checks now if the last check is over a day old.
Checks app sources for network APIs outside the updater.
func testNoNetworkCodeOutsideUpdater() throws { let dir = URL(fileURLWithPath:#filePath).deletingLastPathComponent().deletingLastPathComponent().appendingPathComponent("Sources") let files = try XCTUnwrap(FileManager.default.enumerator(at:dir,includingPropertiesForKeys:nil)) let pattern = #"\b(URLSession\w*|NWConnection\w*|CFStream\w*|CF(Read|Write)StreamCreatePairWithSocket\w*|socket|connect|getaddrinfo|WKWebView|NSURLConnection)\b|import\s+(Network|CFNetwork|WebKit)\b"# // Comments may mention these words (the provider headers do), so strip them first. func code(_ text: String) -> String { text.replacingOccurrences(of: #"/\*[\s\S]*?\*/"#, with: "", options: .regularExpression) .replacingOccurrences(of: #"//[^\n]*"#, with: "", options: .regularExpression)
Requires macOS 13 or later on Apple silicon or Intel.
git clone https://github.com/navbuildz/ai-usage-menu.git
cd ai-usage-menu
./app/build.sh
Run the build script from the repository root with Xcode and the Swift 6 toolchain installed.
How to add a provider
Implement the provider interface, map its output to usage windows and add fixtures covering a successful reading, a missing reading and an error. Follow the contribution guide for review. The Claude Code and Codex readers shown above are the patterns to follow.
Contributing and security
Read the contributing guide and code of conduct before submitting changes. Use the security policy to report a vulnerability privately.
License
The MIT license permits use, modification and redistribution with its copyright and license notice. For a release binary, use the download page to check distribution and verification details.
What can I inspect in an open source Claude usage tracker?
In an open source Claude usage tracker, the provider interface and parsing tests tell you more than a screenshot alone. Begin with the Claude reader to see how a local command becomes a usage snapshot. Then follow the parser into a test fixture containing the labels, fractions and reset times it expects.
Where do releases live on GitHub?
The project's GitHub repository is the source for release notes, licenses and published binaries. Each release lists what changed and links the signed, notarized disk image.
How do I contribute to a Swift menu bar app?
For a contribution to this Swift menu bar app, a small fixture is a useful starting point. Capture a representative provider response with personal identifiers removed, then state the behavior you expect from the parser. A missing limit, an explicit zero and a reached-limit message can all arrive in slightly different records.
Found a bug or want a feature?
Tell us on GitHub. Bugs and feature requests go to Issues; questions and ideas go to Discussions.