[BUG] ant auth login switches Claude Code to API billing

Open 💬 4 comments Opened May 20, 2026 by chew-z

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:

  1. Creates a credentials file at ~/.config/anthropic/credentials/default.json containing Console OAuth credentials (user:developer scope, tied to your Console org)
  2. Writes ~/.config/anthropic/active_config pointing 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-file overrides a subscription login
  • Or Claude Code should not read active_config at all, since it has its own auth flow via claude login
  • Or ant auth login should warn that it may affect Claude Code billing

Error Messages/Logs

Steps to Reproduce

  1. Login to your Max subscription in Claude
  2. ant auth login
  3. 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

View original on GitHub ↗

This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗