You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(auth): user-selectable auth mode (subscription vs api_key)
Adds detection, persistent choice, and runtime enforcement of the
credential Claude Code subprocesses use for LLM scanner/auditor work.
Fixes "Credit balance is too low" and 401 authentication_error when
users have both an empty-balance ANTHROPIC_API_KEY lingering in shell
rc and an active Claude Code subscription — Claude Code prefers the
env var over OAuth, so axme-code now deletes it from the spawn env
when the user chose subscription mode.
- detectAuthOptions reports API key (masked) + subscription (macOS
Keychain or ~/.claude/.credentials.json). No live API probe.
- User-level config at ~/.config/axme-code/auth.yaml (per machine,
not per project — D-132).
- axme-code setup prompts once on first interactive run; stores
choice. Non-TTY contexts skip prompt, fall back to heuristic
without persisting.
- New subcommands: axme-code auth / auth status / auth use <mode>
for re-detection and non-interactive override.
- buildAgentEnv() in agent-options.ts strips ANTHROPIC_API_KEY when
mode=subscription; session-auditor and memory-extractor switched
to share the same helper so auth behavior is consistent across
every Claude Code subprocess we spawn.
- Tests: auth-detect (env handling, masking), auth-config (save/load
roundtrip, corrupt YAML, unknown mode, HOME-based path).
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
#!axme pr=none repo=AxmeAI/axme-code
0 commit comments