Skip to content

Fix macOS OAuth: fall back to credential files when Keychain is missing#15

Merged
tylergraydev merged 1 commit into
mainfrom
fix/macos-credential-file-fallback
Feb 19, 2026
Merged

Fix macOS OAuth: fall back to credential files when Keychain is missing#15
tylergraydev merged 1 commit into
mainfrom
fix/macos-credential-file-fallback

Conversation

@tylergraydev

Copy link
Copy Markdown
Owner

Summary

Test plan

  • Verify Keychain-based token retrieval still works when the Keychain entry exists
  • Verify file-based fallback works when Keychain entry is missing but ~/.claude/.credentials.json exists
  • Verify -- is still shown when neither Keychain nor credential files are available

…ails

When the macOS Keychain entry "Claude Code-credentials" is missing,
getOAuthTokenMacOS() now falls back to reading credential files
(~/.claude/.credentials.json, ~/.claude/credentials.json,
~/.config/claude-code/credentials.json), matching the existing
Linux and Windows behavior.

Fixes #12
xicv pushed a commit to xicv/claude-limitline that referenced this pull request Feb 19, 2026
When the macOS Keychain entry doesn't exist (e.g., after re-authenticating
in tmux/byobu), fall back to checking credential files (~/.claude/.credentials.json,
etc.) matching the existing Linux behavior.

Based on tylergraydev#15

Co-Authored-By: Claude Opus 4.6 <noreply@anthropic.com>
@tylergraydev
tylergraydev merged commit df857d1 into main Feb 19, 2026
3 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

macOS: No fallback to ~/.claude/.credentials.json when Keychain entry is missing

1 participant