Token Meter's Sign in to Claude Code, Allow Keychain access, and Get Claude Code buttons only perform the steps described on this page, one click at a time. Follow these instructions if you prefer to do them yourself.
Token Meter never refreshes Claude's credentials itself because rotating the token would break Claude Code's own session. It reads the credential once only to ask Anthropic for your usage.
1. Check whether Claude Code is installed
command -v claude
If a path is displayed, Claude Code is installed. If nothing is displayed, install it from https://claude.com/claude-code.
Token Meter can count tokens even when the CLI is not on your PATH; it only needs to read the logs in ~/.claude/projects. The claude command is required only when signing in again with these steps.
2. Sign in again
In Terminal, run:
claude
After it starts, enter this in the REPL:
/login
Complete the sign-in in the browser that opens. /login is a slash command inside the interactive REPL, not a CLI flag, so Token Meter and other external tools cannot complete it unattended.
After signing in, click Re-check in Token Meter.
3. Grant Keychain access
To show your remaining Claude Pro / Max usage, Token Meter must read the Claude Code-credentials item that Claude Code saved in macOS Keychain.
The first time it reads the item, macOS displays a dialog similar to this:
"Token Meter" wants to use your confidential information stored in "Claude Code-credentials" in your keychain.
- Choose Always Allow to prevent the dialog from appearing on future refreshes.
- Choose Allow to grant access once. macOS will ask again on the next refresh.
- Choose Deny to reject access. You will then need to follow the steps under “If you selected Deny.”
Token Meter's Allow Keychain access button performs this read once on demand so the dialog appears immediately after you click, rather than during a background refresh.
If you selected Deny
macOS remembers the denial for each Keychain item, so Token Meter cannot undo it. Change the permission in Keychain Access:
- Open Keychain Access. Search for “Keychain Access” with Spotlight. Depending on your macOS version, the app is in
/System/Applications/Utilities/or/System/Library/CoreServices/Applications/. - Search for and open
Claude Code-credentials. - On the Access Control tab, allow Token Meter. Alternatively, remove Token Meter from the list so macOS asks again next time.
- Return to Token Meter and click Re-check.
If you do not want Claude usage displayed, turn off Claude Pro / Max usage in Settings. Keychain reads and network access will stop, while token counts from local logs will continue to work.
4. Troubleshooting
| Symptom | What to check |
|---|---|
| “Your sign-in has expired” does not disappear | Start claude, run /login again, and click Re-check when finished. |
command not found: claude |
The install location is not on your PATH. Check .zprofile and .zshrc. |
| Access is denied without a dialog | Follow the steps under “If you selected Deny.” |
| You replaced the app with a newly signed build | macOS treats it as a different binary, so you must grant Keychain access again. |