01
Store it once
Click the key in your menu bar and paste. KeyBar recognises keys from dozens of services and fills in the name for you, like ANTHROPIC_API_KEY or GITHUB_TOKEN. Got a .env file? Import it and pick which lines to bring in.
Keep your keys for Claude, Cloudflare, GitHub and the rest in your Mac's Keychain. Claude Code uses them by name to run commands, and never sees the values.
For Mac · macOS 14 or later · Works with Claude Code, Cursor, Codex and more · Installs with Homebrew · Open source
What it does
No more keys in .env files, shell history or chat transcripts. Store each one once, and Claude Code finds it when it needs it.
01
Click the key in your menu bar and paste. KeyBar recognises keys from dozens of services and fills in the name for you, like ANTHROPIC_API_KEY or GITHUB_TOKEN. Got a .env file? Import it and pick which lines to bring in.
02
Click Connect Claude Code and KeyBar adds its MCP server to Claude Code for all your projects. Ask Claude to deploy your site or call an API, and it runs the command with your key set as an environment variable. Any copy of the key in the output, as written, base64, URL-encoded or reversed, comes back as [REDACTED].
list_secrets: the names of your keys and what they're for. Never the values.run_with_secrets: runs a command with the keys it names, then hides them in what it prints.request_secret: asks you for a key it needs, with what it's for. You paste it into KeyBar, not the chat.send_secret: puts a key into a GitHub repo or a Cloudflare Worker for a deploy, after your Touch ID.
03
Showing or copying a key asks for Touch ID, or your Mac's password. Before Claude Code uses a key, KeyBar asks too, and the prompt shows the exact command it wants to run. One yes covers the same keys in the same project for 15 minutes, or choose every time.
04
See which key was used, by you or by Claude Code, the program it ran, the folder, the exit code and whether anything was hidden. Refusals are logged with the reason. Values never are.
05
Lock a key to the project folders that need it, and commands anywhere else are refused. Give it an expiry date and KeyBar reminds you two weeks before. A command with a key's actual value pasted into it is refused too, so values stay out of the chat. Not using a key for now? Archive it, and Claude can't see it until you restore it.
06
The window gathers every key by service or by your own groups, in your own order, with search across names, services, groups and notes. Tags show which keys expire soon and where each one was sent.
07
A deploy needs the key too? Tick your GitHub repos, or name a Cloudflare Worker or Pages project, and KeyBar puts it into their secrets after one Touch ID. The value goes straight to gh or wrangler, never on screen. Made a new key? Send again puts it everywhere the old one went.
08
When Claude needs a key you haven't stored, it asks KeyBar instead of the chat. Add key opens with the name filled in and Claude's reason above it, like where to make the key. You paste it in, and Claude only hears that it's ready.
09
Leak check looks for your stored keys in AI chat logs, shell history and git history, the places keys end up after a paste, and says who could have seen each copy. Hide a copy with one click, or rotate the key. It all runs on your Mac.
10
Open the service's keys page, paste the new key and test it. One Touch ID saves it and sends it to every repo and Worker the old one went to. Then KeyBar reminds you to revoke the old key.
11
Turn on the commit guard and every commit in every repo is checked for your keys first, whether you or Claude made it. Your repos' own hooks still run. A .keybar file in a project lists the keys it needs, and there Claude sees only those.
12
For Anthropic, OpenAI and Groq keys, turn on KeyBar's proxy. Commands get a placeholder and a local address their SDK calls instead, and KeyBar adds the key on the way out. The command never has the key, so it can't leak it.
And the little things
Small details that make it easy to live with every day.
A copied key is wiped after 20 seconds, or 1 or 2 minutes, and clipboard managers are asked to skip it.
CLOUDFLARE_API_TOKEN shows as Cloudflare's API token, STRIPE_PUBLISHABLE_KEY as Stripe's publishable key. All built in, so nothing goes online to look it up.
A coral dot on the menu bar key tells you when Claude Code isn't connected. You can turn it off.
If KeyBar isn't running when Claude Code needs a key, it starts quietly in the background.
Check for updates in Settings. KeyBar quits, updates through Homebrew and reopens.
Press ⌥⌘K in any app, type a few letters of a key's name and press Return. It's copied after Touch ID.
A notification two weeks before a key expires, and on the day, so a deploy never breaks on a dead token.
Click Test and KeyBar asks the key's own service if it still works. GitHub and Cloudflare tokens fill in their expiry date too.
A Google service account's .json or Apple's .p8 goes in like any key. Commands get the path to a private copy, deleted when they finish.
Turn on iCloud Keychain sync and every Mac you sign in to has the same keys, groups and notes, encrypted end to end by Apple.
Keys no command has used for 90 days get a nudge to archive them, out of Claude's reach until they're needed again.
Connect Claude Desktop, Cursor, Windsurf, VS Code, Codex CLI and Gemini CLI from the same screen as Claude Code. The log names the app.
Ask every time for a live payments key, never for a harmless one, and Settings decides the rest.
keybar run -- npm run dev sets a project's keys for your own commands, from its .keybar list or .env, with Touch ID every time.
Built in SwiftUI with no Electron. Light and dark mode, and a padlock that's always pleased to see you.
Take a look
The menu bar panel and the window share the same colourful style, in light and dark.



Private by design
Each key is its own item in your Mac's login Keychain, or iCloud Keychain if you turn on sync. Values are never written anywhere else, and KeyBar's list holds only names.
KeyBar hands keys only to its own signed helper, the MCP server Claude Code runs, and only for one command at a time. Anything else that asks is turned away.
No analytics, no account and nothing collected. On its own it only goes online to check for updates. Test talks only to the key's own service, and only when you click. It's open source, so you can check.
A command that's given a key really has it, so it could still send it somewhere. KeyBar can't protect keys from programs already running on your Mac as you, and it hasn't been independently audited. Read what Claude wants to run, and use folder limits and Touch ID for the keys that matter.
KeyBar is free. It installs with Homebrew, a free and widely used tool for installing Mac apps and keeping them up to date. You only need to set it up once.
Get Homebrew. Download the installer, open it and click through, like any Mac installer. It asks for your Mac password. Already have Homebrew? Skip to step 2.
Download HomebrewOpen Terminal, an app that comes with every Mac. Press ⌘ Space, type Terminal and press Return. A window with a blinking cursor opens.
Click Copy, paste into Terminal with ⌘ V and press Return. Text scrolls past while Homebrew installs KeyBar. It's done when it stops.
$ brew tap RossNicholson/tap$ brew trust --cask rossnicholson/tap/keybar$ brew install --cask keybar
See command not found: brew? Quit Terminal with ⌘ Q, open it again and paste once more.
Open KeyBar from your Applications folder. If your Mac asks whether you're sure you want to open it, click Open. Add your first key, then go to Claude Code and click Connect Claude Code. New Claude Code sessions can use your keys straight away.
Your Mac checks with you before an app can do certain things. Here's what KeyBar asks for, and what to do.
On an older Homebrew, an error about brew trust is safe to ignore.
KeyBar is free, open source, and signed and notarized by Apple.
Enjoying it? Buy me a coffee ☕ · Need help? Support
Also from me: ClawdBar, your Claude Code limits in the menu bar, and BrewDock, Homebrew in your menu bar
KeyBar is an independent app and isn't affiliated with or endorsed by Anthropic. Claude and Claude Code are trademarks of Anthropic.