Field notes
2026-05-11 — Claude subscription OAuth
CLAUDE_CODE_OAUTH_TOKENaccepted as alt provider auth. Generated viaclaude setup-tokenon a machine already logged into Claude Code; lets operators run slaude on a Pro/Max subscription instead of metered API credits. Three touchpoints:src/agent/manager.ts— addedCLAUDE_CODE_OAUTH_TOKENto the env-passthrough whitelist for the SDK child. The SDK CLI natively reads this env var and switches to OAuth Bearer againstapi.anthropic.com. No code change inside the SDK is needed.src/soul/extract.ts— directfetch /v1/messages. When onlyCLAUDE_CODE_OAUTH_TOKENis set (noANTHROPIC_API_KEY), the request carriesAuthorization: Bearer <tok>+anthropic-beta: oauth-2025-04-20instead ofx-api-key. The beta header is mandatory — bearer-token requests without it 401 on Anthropic. API key wins when both env vars are set (explicit > subscription).src/config/env.ts— addedenv.provider.oauthToken()accessor for symmetry / future callers. Not consumed yet outside of the env propagation path.
- Test coverage added:
tests/soul-extract.test.tsasserts header shape on the OAuth branch + API-key precedence when both present.tests/config.test.tsextends the populated-getters case. 175 pass total. - BREAKING (same release):
SLAUDE_MODELsemantics changed from "default = claude-sonnet-4-6" to "override; empty = let the SDK pick".env.model()returns""when unset;manager.tsonly setsoptions.modelwhen truthy. Rationale: withCLAUDE_CODE_OAUTH_TOKEN, Claude Code's CLI already knows the subscription's default model — hardcodingclaude-sonnet-4-6in slaude either pinned the wrong tier or silently overrode the user's Pro/Max default. With non-Anthropic gateways the operator was already forced to setSLAUDE_MODEL(their endpoint doesn't speak Anthropic's default id), so this change is no-op for them. Soul extractor still has its own fallback chain (SLAUDE_SOUL_PARSE_MODEL || SLAUDE_MODEL || claude-haiku-4-5-20251001) because it calls/v1/messagesdirectly andmodelis a required field.