fix: add credentials file fallback for macOS when Keychain entry is missing#13
Closed
rbarcante wants to merge 1 commit into
Closed
fix: add credentials file fallback for macOS when Keychain entry is missing#13rbarcante wants to merge 1 commit into
rbarcante wants to merge 1 commit into
Conversation
…issing
On macOS, when the Keychain entry for Claude Code doesn't exist (e.g.,
after re-authenticating in a tmux/byobu session), the token retrieval
fails silently and usage data shows as "--".
This adds:
- File-based fallback to ~/.claude/.credentials.json (and other paths),
matching the existing behavior on Linux and Windows
- Support for multiple Keychain service names ("Claude Code" and
"Claude Code-credentials") since different versions may use different names
- JSON parsing for Keychain values, since credentials may be stored as
a JSON object rather than a raw token string
Closes tylergraydev#12
rbarcante
force-pushed
the
fix/macos-credentials-file-fallback
branch
from
February 9, 2026 13:06
251865b to
8696824
Compare
Owner
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
~/.claude/.credentials.json, etc.), matching existing Linux/Windows behavior"Claude Code"and"Claude Code-credentials")Closes #12
Problem
On macOS, when the Keychain entry doesn't exist (e.g., after re-authenticating via
/loginin a tmux/byobu session where credentials get written to~/.claude/.credentials.jsoninstead of the Keychain),getOAuthTokenMacOS()returnsnullwithout trying file-based fallbacks. This causes usage segments to display--.Test plan
~/.claude/.credentials.json→ usage data displays correctly