claudeers.
// Claude Plugins

claude-code-usage-swiftbar

Claude Code usage for SwiftBar.

// Claude Plugins[ api ][ web ][ claude ]#claude#anthropic#claude-code#developer-tools#macos#menubar#plugin#swiftbar#plugins◷ MIT$open-sourceupdated about 1 month ago
Actively maintained
100/100
last commit about 1 month ago
last release about 2 months ago
releases 1
open issues 0
// star history

Install with your AI

Paste into Claude Code, Cursor, or any agent — it reads the repo and wires the tool into your project.

Install and set up claude-code-usage-swiftbar (release-binary project) into my current project.
Found on https://claudeers.com/claude-code-usage-swiftbar
Repo: https://github.com/agusalvarez6/claude-code-usage-swiftbar
Homepage/docs: —
Detected install method: release-binary → inspect the README
Category: plugins. Platforms: api, web.
Read the repo's README for exact setup and env vars, then install it and wire it into my project.

Claudeers Health Verdict:
active; community-verified: false. Confirm the source before running anything.
// or install directly (release-binary)

Grab the latest release asset from GitHub.

# download a build from https://github.com/agusalvarez6/claude-code-usage-swiftbar/releases
// or clone
git clone https://github.com/agusalvarez6/claude-code-usage-swiftbar

// compatibility

Platformsapi, web
Operating systems—
AI compatibilityclaude
LicenseMIT
Pricingopen-source
LanguageShell

Get your FREE $2.50 API credits to access TickAtlas financial data ↗

Claude Code Usage for SwiftBar

This SwiftBar plugin shows Claude Code's rolling 5-hour and 7-day usage in the macOS menu bar. It uses the same data as Claude Code's /usage command.

The plugin in the macOS menu bar reading 5h 61% and 7d 36%, with its dropdown open on the 5-hour and 7-day rows

The crab reacts as either window approaches its limit. The 5-hour row estimates when the current average pace will reach the limit.

Security and data

The plugin reads Claude Code's OAuth access token from your macOS Keychain. It keeps the token in memory and sends it only to api.anthropic.com over HTTPS. It doesn't write the token to disk or refresh it.

The cache in $TMPDIR stores the last usage result and fetch time. It contains no credentials.

The plugin uses only Node.js built-ins. It requires no API key or background service.

Requirements

  • macOS with SwiftBar
  • Node.js 18 or later on your PATH
  • An active Claude Code login

Install

  1. Install SwiftBar:

    brew install --cask swiftbar
    
  2. Open SwiftBar and select a plugin folder.

  3. Clone this repository and run the installer:

    git clone https://github.com/agusalvarez6/claude-code-usage-swiftbar.git
    cd claude-code-usage-swiftbar
    ./install.sh
    
  4. On the first run, click Always Allow when macOS asks to read the Claude Code-credentials Keychain item.

install.sh copies cc-usage.2m.js into SwiftBar's plugin folder and refreshes it. Run it again after pulling updates. The installer preserves the configured refresh interval.

To uninstall the plugin, delete the installed file:

rm "$(defaults read com.ambar.SwiftBar PluginDirectory)"/cc-usage.*m.js

Behavior

  • The menu bar shows usage in green below 50%, yellow from 50% through 89%, and red at 90% or higher.
  • SwiftBar sends the 90% notification only when macOS grants permission in System Settings > Notifications.
  • After a failed request, the plugin shows the most recent successful result. It marks that result as cached after 10 minutes.
  • The filename controls the polling interval. Rename the installed file to cc-usage.5m.js or cc-usage.10m.js to poll less often. The installer preserves the renamed file.
  • If SwiftBar reports "node not found," add the Node.js executable path to the launcher list on line 2 of cc-usage.2m.js.

Limitations

  • The plugin uses Claude Code's undocumented /api/oauth/usage endpoint. An endpoint change can break the plugin.
  • If the token expires, open Claude Code to renew your login.

This project isn't affiliated with Anthropic or SwiftBar.

License

MIT. See LICENSE.

// faq

What is claude-code-usage-swiftbar?

Claude Code usage for SwiftBar.. It is open-source on GitHub.

Is claude-code-usage-swiftbar free to use?

claude-code-usage-swiftbar is open-source under the MIT license, so it is free to use.

What category does claude-code-usage-swiftbar belong to?

claude-code-usage-swiftbar is listed under plugins in the Claudeers registry of Claude-compatible tools.

9 views
★ 10 stars
unclaimed
updated about 1 month ago

// embed badge

claude-code-usage-swiftbar on Claudeers
[![Claudeers](https://claudeers.com/api/badge/claude-code-usage-swiftbar.svg)](https://claudeers.com/claude-code-usage-swiftbar)

// retro hit counter

claude-code-usage-swiftbar hit counter
[![Hits](https://claudeers.com/api/counter/claude-code-usage-swiftbar.svg)](https://claudeers.com/claude-code-usage-swiftbar)

// reviews

// guestbook

0/500

// related in Claude Plugins

🔓

A single CLAUDE.md file to improve Claude Code behavior, derived from Andrej Karpathy's observations on LLM coding pitfalls.

// pluginsmultica-ai/★ 215,548[ claude ]
🔓

Claude Code is an agentic coding tool that lives in your terminal, understands your codebase, and helps you code faster by executing routine tasks, explainin…

// pluginsanthropics/⟨Python⟩★ 147,969[ claude ]
🔓

"CLI-Anything: Making ALL Software Agent-Native" -- CLI-Hub: https://clianything.cc/

// pluginsHKUDS/⟨Python⟩★ 50,756◷ Apache-2.0[ claude ]
🔓

financial-services — a Claude ecosystem project on GitHub.

// pluginsanthropics/⟨Python⟩★ 37,359◷ Apache-2.0[ claude ]
→ see how claude-code-usage-swiftbar connects across the ecosystem