[BUG] ant auth login switches Claude Code to API billing
Preflight Checklist
- [x] I have searched existing issues and this hasn't been reported yet
- [x] This is a single bug report (please file separate reports for different bugs)
- [x] I am using the latest version of Claude Code
What's Wrong?
ant CLI Breaks Claude Code Max Subscription Billing
The Problem
When you install and authenticate the Anthropic CLI tool (ant) for working with Claude Managed Agents, it silently hijacks Claude Code's billing from your Max subscription to API usage billing — charging you per-token via the Console instead of using your flat-rate subscription.
Root Cause
Both ant and Claude Code share the config directory ~/.config/anthropic/. When you run ant auth login, it:
- Creates a credentials file at
~/.config/anthropic/credentials/default.jsoncontaining Console OAuth credentials (user:developerscope, tied to your Console org) - Writes
~/.config/anthropic/active_configpointing to the active profile
Claude Code reads active_config, follows the pointer, finds Console OAuth credentials, and silently prefers them over your Max subscription — with zero warning. The only visible indicator is the status line changing from Claude Max to API Usage Billing.
How to Detect
In Claude Code, check /status. If you see:
Profile: credentials-file · user_oauth · profile <name>
…instead of your subscription info, ant credentials are overriding your subscription.
The Fix
# Remove the active_config pointer
rm ~/.config/anthropic/active_config
# Re-login to Claude Code with your subscription
claude logout
claude login
# Select option 1: "Claude account with subscription"
Using Both Tools Together
The key is preventing ant from writing active_config by always specifying the profile explicitly via environment variable.
1. Move ant to a named profile
# If you haven't already
ant auth logout
ant auth login --profile agents
2. Remove active_config if it exists
rm ~/.config/anthropic/active_config
3. Add a shell alias (recommended)
In ~/.zshrc:
alias ant='ANTHROPIC_PROFILE=agents ant'
This makes ant always use the agents profile without writing active_config. Claude Code never sees the Console credentials and stays on your Max subscription.
4. Alternative: use direnv for project-scoped setup
In your Managed Agents project directory, create .envrc:
# .envrc
export ANTHROPIC_PROFILE=agents
Then ant picks up Console credentials only inside that project.
Verify
After setup, confirm both tools work:
# ant should show the agents profile
ant auth status
# → Active profile: agents
# Claude Code should show Max
# Run /status inside Claude Code
# → Should NOT say "credentials-file"
# Status line should say "Claude Max", not "API Usage Billing"
What Should Happen?
- Claude Code should warn when
active_config/credentials-fileoverrides a subscription login - Or Claude Code should not read
active_configat all, since it has its own auth flow viaclaude login - Or
ant auth loginshould warn that it may affect Claude Code billing
Error Messages/Logs
Steps to Reproduce
- Login to your Max subscription in Claude
ant auth login- In Claude Code, check /status.
If you see:
Profile: credentials-file · user_oauth · profile <name>
…instead of your subscription info, ant credentials are overriding your subscription.
Claude Model
None
Is this a regression?
I don't know
Last Working Version
_No response_
Claude Code Version
2.1.145
Platform
Anthropic API
Operating System
macOS
Terminal/Shell
Other
Additional Information
Costed me $120 to learn. Thankfully set sane limits for the workspace
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗