English | 简体中文 | 繁體中文 | 日本語 | 한국어 | हिन्दी | Tiếng Việt | Français | Русский | Español | Português | Norsk | Svenska | Deutsch | Nederlands | Italiano
GAC supports authentication via Claude Code subscriptions, allowing you to use your Claude Code subscription instead of paying for the expensive Anthropic API. This is perfect for users who already have Claude Code access through their subscription.
⚠️ Heads up — unsanctioned use: Anthropic has been actively cracking down on third-party tools that use Claude Code OAuth tokens outside of the Claude Code CLI itself, sometimes revoking access. gac is small enough that it has flown under the radar so far, but using Claude Code (OAuth) here is not officially sanctioned and could stop working at any time. If you need reliable commit-message generation, use a direct API provider (anthropic,openai, etc.) instead. See Anthropic's Claude Code subscription docs for the current policy.
Claude Code is Anthropic's subscription service that provides OAuth-based access to Claude models. Instead of using API keys (which are billed per-token), Claude Code uses OAuth tokens from your subscription.
- Cost effective: Use your existing Claude Code subscription instead of paying separately for API access
- Same models: Access the same Claude models (e.g.,
claude-sonnet-4-5) - Separate billing: Claude Code usage is separate from Anthropic API billing
GAC includes built-in OAuth authentication for Claude Code. The setup process is fully automated and will open your browser for authentication.
When running uvx gac init, simply select "Claude Code" as your provider:
uvx gac initThe wizard will:
- Ask you to select "Claude Code" from the provider list
- Automatically open your browser for OAuth authentication
- Save your access token to
~/.gac.env - Set the default model
If you already have GAC configured with another provider and want to switch to Claude Code:
uvx gac modelThen:
- Select "Claude Code" from the provider list
- Your browser will open automatically for OAuth authentication
- Token saved to
~/.gac.env - Model configured automatically
Once authenticated, use GAC as usual:
# Stage your changes
git add .
# Generate and commit with Claude Code
uvx gac
# Or override the model for a single commit
uvx gac -m claude-code:claude-sonnet-4-5Claude Code provides access to the same models as the Anthropic API. Current Claude 4.5 family models include:
claude-sonnet-4-5- Latest and most intelligent Sonnet model, best for codingclaude-haiku-4-5- Fast and efficientclaude-opus-4-5- Most capable model for complex reasoning
Check the Claude documentation for the full list of available models.
If you see authentication errors, your token may have expired. Re-authenticate by running:
uvx gac auth claude-code loginYour browser will open automatically for fresh OAuth authentication. Alternatively, you can run uvx gac model, select "Claude Code (OAuth)", and choose "Re-authenticate (get new token)".
To check if you're currently authenticated:
uvx gac auth claude-code statusOr check all providers at once:
uvx gac authTo remove your stored token:
uvx gac auth claude-code logoutThis means GAC can't find your access token. Authenticate by running:
uvx gac modelThen select "Claude Code" from the provider list. The OAuth flow will start automatically.
If OAuth authentication fails:
- Make sure you have an active Claude Code subscription
- Check that your browser opens correctly
- Try a different browser if issues persist
- Verify network connectivity to
claude.ai - Check that ports 8765-8795 are available for the local callback server
| Feature | Anthropic (anthropic:) |
Claude Code (claude-code:) |
|---|---|---|
| Authentication | API Key (ANTHROPIC_API_KEY) |
OAuth (automated browser flow) |
| Billing | Per-token API billing | Subscription-based |
| Setup | Manual API key entry | Automatic OAuth via uvx gac init or uvx gac model |
| Token Management | Long-lived API keys | OAuth tokens (can expire, easy re-auth via model) |
| Models | Same models | Same models |
- Never commit your access token to version control
- GAC automatically stores tokens in
~/.gac.env(outside your project directory) - Tokens may expire and will require re-authentication via
uvx gac model - The OAuth flow uses PKCE (Proof Key for Code Exchange) for enhanced security
- Local callback server runs on localhost only (ports 8765-8795)