Auto mode unavailable despite Max plan — API rejects afk-mode beta header

Status Fixed / completed
Reported on v2.1.86
Maintainer reply None cached
Activity 3 comments · opened Mar 28, 2026 · closed Mar 28, 2026

Bug Description

Auto mode shows "Auto mode is unavailable for your plan" in the status line despite being on the Max plan.

Environment

  • Claude Code version: 2.1.86
  • OS: macOS (Darwin 25.3.0)
  • Plan: Max (subscriptionType: "max" confirmed via claude auth status)
  • Setting: "defaultMode": "auto" in ~/.claude/settings.json

Root Cause (from source)

In cli.js, when auto mode is active, Claude Code sends the anthropic-beta: afk-mode-2026-01-31 header. The API returns a 400 error whose message includes "afk-mode-2026-01-31" and "anthropic-beta", triggering this code path:

if (cW6 && q.status === 400 && q.message.includes(cW6) && q.message.includes("anthropic-beta"))
  return G_({ content: "Auto mode is unavailable for your plan", error: "invalid_request" });

Where cW6 = "afk-mode-2026-01-31".

Steps to Reproduce

  1. Be on the Max plan
  2. Set "defaultMode": "auto" in settings.json
  3. Start a Claude Code session
  4. Observe "auto mode is unavailable for your plan" in terminal status

Expected Behavior

Auto mode should work for Max plan subscribers.

Auth Status

{
  "loggedIn": true,
  "authMethod": "claude.ai",
  "apiProvider": "firstParty",
  "subscriptionType": "max"
}

Workaround

Switching to "defaultMode": "bypassPermissions" avoids the issue but loses the AI classifier behavior that auto mode provides.

View original on GitHub ↗

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