docs(claude-code): document oauthToken config and the macOS SDK bug #13
Reference in New Issue
Block a user
Delete Branch "fix/claude-code-oauth-token"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After investigating, the @anthropic-ai/claude-agent-sdk has a macOS-
specific upstream bug that breaks subscription auth: the SDK isolates
CLAUDE_CONFIG_DIR per invocation and tries to copy
~/.claude/.credentials.json, which doesn't exist on macOS (creds live
in the Keychain). The spawned CLI then misclassifies the OAuth token
as an API key and bills against API credits.
Changes:
CLAUDE_CODE_OAUTH_TOKEN before invoking the SDK. Wired up and ready
for when the upstream bug is fixed; currently affected by it on macOS.
reliably; subscription mode is broken on macOS pending upstream fix.
ANTHROPIC_API_KEY as the workaround so users can self-diagnose.
smoke test attempts the subscription path when configured.
No code changes silently in flight — when the SDK fixes the Keychain
handling, subscribers will Just Work without any code changes here.
Pull request closed