[BUG] Fast mode forcibly disabled when using ANTHROPIC_BASE_URL (custom API endpoint)

Resolved 💬 3 comments Opened Feb 26, 2026 by Ashesh3 Closed Apr 12, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report
  • [x] I am using the latest version of Claude Code

What's Wrong?

When using ANTHROPIC_BASE_URL to route API traffic through a corporate middleware proxy (required by our organization's security policy), fast mode is forcibly disabled even though our Anthropic org has fast mode enabled.

Root Cause (from investigating the bundled source)

The fast mode availability check (claude_code_penguin_mode) is hardcoded to https://api.anthropic.com — it does not respect ANTHROPIC_BASE_URL:

// In the bundled CLI, the penguin mode check:
let q = `${o4().BASE_API_URL}/api/claude_code_penguin_mode`
// o4().BASE_API_URL always resolves to "https://api.anthropic.com" in production
// It does NOT use process.env.ANTHROPIC_BASE_URL

In our environment, API traffic must flow through a corporate proxy/middleware layer. Direct connections to api.anthropic.com from developer workstations are blocked by firewall rules. So:

  1. We set ANTHROPIC_BASE_URL to our internal proxy endpoint — message API calls work fine
  2. The penguin mode check ignores ANTHROPIC_BASE_URL, tries to reach api.anthropic.com directly, fails due to network policy
  3. On failure, the code defaults to { status: "disabled" } — fast mode is force-disabled
  4. The /fast toggle shows "Fast mode is not available" despite our org having it enabled

There's also a secondary issue: the tengu_marble_sandcastle GrowthBook feature flag defaults to true when GrowthBook can't be reached (same network issue), which gates fast mode to native binary installs only. Combined with CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1 (commonly set in proxy environments), GrowthBook never loads real values and the restrictive defaults stick.

What Should Happen?

  1. The penguin mode check should respect ANTHROPIC_BASE_URL — if set, use it as the base for /api/claude_code_penguin_mode instead of the hardcoded api.anthropic.com. The function IDz() already exists in the codebase and correctly reads ANTHROPIC_BASE_URL, but it's not used for this check.
  1. Failure should not force-disable fast mode — if the penguin mode endpoint is unreachable (network error, timeout, non-2xx), the current behavior defaults to disabled. A better approach would be:
  • Fall back to the persisted penguinModeOrgEnabled config value
  • Or keep the status as pending (which already passes the availability check) and retry later
  • Or at minimum, provide an env var override (e.g., CLAUDE_CODE_FORCE_FAST_MODE=1) to let admins/users who know their org supports it bypass the check
  1. GrowthBook feature flag defaults should be permissive when unreachabletengu_marble_sandcastle defaulting to true (require native binary) when GrowthBook can't be reached is overly restrictive for proxy environments.

Steps to Reproduce

  1. Set ANTHROPIC_BASE_URL to any non-api.anthropic.com endpoint (corporate proxy, middleware, etc.)
  2. Ensure the workstation cannot directly reach api.anthropic.com (or set CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1)
  3. Start Claude Code
  4. Try /fast — shows "Fast mode is not available"
  5. Observe in verbose/debug logs: the penguin mode fetch goes to api.anthropic.com (not the custom base URL), fails, and defaults to disabled

Claude Model

claude-opus-4-6

Is this a regression?

No — fast mode has always behaved this way with custom base URLs.

Claude Code Version

2.1.59

Platform

First-party API with ANTHROPIC_BASE_URL override (corporate proxy)

Operating System

Windows (also reproducible on Linux/macOS)

Terminal/Shell

Various (bash, PowerShell, etc.)

Additional Information

I understand the platform integration needs — verifying org-level fast mode entitlement makes sense. But the current implementation assumes direct connectivity to api.anthropic.com, which isn't always possible in enterprise environments that mandate traffic routing through approved middleware/proxies.

The Anthropic SDK itself correctly respects ANTHROPIC_BASE_URL for message API calls. It would be great if the ancillary checks (penguin mode, GrowthBook features) followed the same pattern, or at least degraded gracefully instead of force-disabling features.

Suggested minimal fix

In IOz(), change:

let q = `${o4().BASE_API_URL}/api/claude_code_penguin_mode`

to:

let q = `${process.env.ANTHROPIC_BASE_URL || o4().BASE_API_URL}/api/claude_code_penguin_mode`

And in the catch handler of YE1(), instead of:

n16 = { status: "disabled", reason: "preference" }

keep the status as pending or respect the persisted config, so fast mode isn't force-killed on transient/expected network failures.

View original on GitHub ↗

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