Claude Code 2.1.330: Enterprise Gateway Sign-In, 30-Day /loop, and max_tokens Retry

Claude Code 2.1.330 adds Enterprise Admin Console sign-in for org cloud providers and gateways, extends /loop and recurring tasks to 30 days while a session stays running, and restores automatic max_tokens retries behind gateways. Learn how to verify your active endpoint, connect via BetterToken or Anthropic routes, manage easel charts, and separate real 2.1.330 changes from third-party rumors.

Contents
Claude Code 2.1.330: Enterprise Gateway Sign-In, 30-Day /loop, and max_tokens Retry

Claude Code 2.1.330 shipped on November 20, 2026, changing how enterprise gateways, long-running /loop schedules, and max_tokens retries behave. This update affects teams adopting Enterprise Admin Console sign-in, developers routing Claude Code through a custom ANTHROPIC_BASE_URL gateway, and anyone running multi-day scheduled tasks. After running claude update and confirming 2.1.330 with claude --version, start claude and run /status to check which endpoint and credential source are active before launching new work.

Choose how to connect Claude Code 2.1.330

Pick one connection path before editing local settings so credentials do not collide. For a wider breakdown of subscription and API billing models, see our guide on Claude Code subscription vs. API billing.

RouteRequirementsBilling unitDocumented client and feature scopeWhen to choose it
Pay-as-you-go API gateway (BetterToken)BetterToken account and API Key; no claude.ai account submission requiredPay-as-you-go per the model’s current billing unit; purchased paid balance does not reset monthlyClaude Code CLI (~/.claude/settings.json) and VS Code extension (claudeCode.environmentVariables) via Anthropic Messages (https://bettertoken.ai); Remote Control, voice input, and easel are unavailableYou want pay-as-you-go access to Claude and other models without running your own gateway or an Enterprise plan
Enterprise Admin Console sign-inEnterprise org membership, Owner-enabled switch, claude 2.1.330+ (plus an updated VS Code extension if used), and org cloud or gateway accessProvider-dependent (billed through your organization’s cloud provider or gateway account)Applies org Desktop 3P settings and Connection provider in terminal and VS Code; Remote Control, cloud sessions, voice mode, and claude.ai connectors are unavailableYour org already manages Claude Desktop connections in the Enterprise Admin Console and wants to stop deploying managed-settings.json
Self-hosted LLM gateway or cloud providerOperated proxy or AWS, Google Cloud, or Azure account, plus gateway or cloud credentialsProvider-dependent (depends on your cloud provider or upstream gateway billing)Claude Code via ANTHROPIC_BASE_URL or provider variables (CLAUDE_CODE_USE_BEDROCK=1, CLAUDE_CODE_USE_VERTEX=1); feature scope depends on the gateway or providerCompliance requires in-house traffic logging, custom spend caps, or cloud billing
Direct claude.ai subscription or Claude Consoleclaude.ai Pro, Max, Ultra, Team, or Enterprise account, or invited Claude Console accountSubscription plan or Claude Console billingSubscription plans support claude.ai-account features such as easel (macOS and Linux outside WSL), Remote Control, and voice inputYou want Anthropic-hosted features with no custom gateway layer

Connect Claude Code 2.1.330 through BetterToken

BetterToken offers an Anthropic-compatible Messages endpoint (https://bettertoken.ai) for Claude Code and lists current Claude models (claude-sonnet-5-5, claude-opus-5-5, claude-haiku-5-5, and claude-fable-5-2) as of 2026-11-21. Check current prices for live rates and cache rules. API access is separate from a claude.ai subscription, so Remote Control, voice input, and easel remain unavailable.

Create an API Key in your BetterToken workspace. Clear competing credentials before testing so Claude Code cannot inherit another login: if you previously signed in to claude.ai, run /logout inside Claude Code, then clear ANTHROPIC_API_KEY and start an interactive session in Bash without echoing your secret:

unset ANTHROPIC_API_KEY
read -rs BETTERTOKEN_API_KEY && export BETTERTOKEN_API_KEY

export ANTHROPIC_BASE_URL="https://bettertoken.ai"
export ANTHROPIC_AUTH_TOKEN="$BETTERTOKEN_API_KEY"
export ANTHROPIC_MODEL="claude-sonnet-5-5"
claude

Do not append /v1 to ANTHROPIC_BASE_URL; Claude Code adds /v1/messages automatically. Inside that session, run /status and verify two lines: Anthropic base URL must display https://bettertoken.ai, and the authentication line must show ANTHROPIC_AUTH_TOKEN rather than a claude.ai account login. If Claude Code warns about two credential sources at startup, run /logout to keep only your BetterToken API Key. After exiting the interactive session, run claude -p "Reply with only: OK" in the same shell; a plain OK reply without 401, connection, or model errors confirms that the verified connection completes a request.

To persist this setup, follow the BetterToken Claude Code setup guide or check the Claude Code API setup overview. On macOS or Linux, run the automatic setup script (curl -fsSL "https://www.bettertoken.ai/install-claudecode-provider.sh" | bash), which requires Node.js and prompts for your API Key when not passed as an argument; then inspect ~/.claude/settings.json (or %USERPROFILE%\.claude\settings.json on Windows, where a PowerShell script is documented) and fully restart Claude Code. For manual CLI setup, add an env object to that file with "ANTHROPIC_BASE_URL": "https://bettertoken.ai", "ANTHROPIC_AUTH_TOKEN" set to your API Key, "API_TIMEOUT_MS": "3000000", "ANTHROPIC_MODEL" set to a verified Model ID copied from current prices (such as claude-sonnet-5-5), and the three role aliases (ANTHROPIC_DEFAULT_HAIKU_MODEL, ANTHROPIC_DEFAULT_SONNET_MODEL, and ANTHROPIC_DEFAULT_OPUS_MODEL). Per the setup guide, you can map all three aliases to the same Model ID or choose a different verified Model ID for each role (for example, claude-haiku-5-5, claude-sonnet-5-5, and claude-opus-5-5). You can also set the optional "CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC": "1", which disables automatic updates, error reporting, and some availability checks and account features, though authentication does not require it. For the VS Code extension, add claudeCode.environmentVariables in VS Code settings.json as an array of {"name": "...", "value": "..."} objects holding those same variable names and values (complete JSON examples appear in the setup guide linked above), then restart Claude Code and recheck /status.

Create a BetterToken account

If you prefer Anthropic’s own routes, follow Manage Claude Code in the terminal from the Enterprise Admin Console for organization sign-in, or configure a claude.ai subscription, Claude Console login, or cloud provider from the Claude Code authentication guide.

Verify Enterprise Admin Console sign-in and gateway priority

In 2.1.330, claude auth login lets developers sign in to an organization managed in Anthropic’s Enterprise Admin Console. While that sign-in stays active (about a month), Claude Code applies the organization’s console settings and routes model requests to the cloud provider or gateway saved on the Connection page under Organization settings > Desktop 3P.

An Owner or Primary Owner must save the Connection page under Organization settings > Desktop 3P and enable Allow sign-in from Claude Code in terminals and IDEs (off by default). Turn it on for everyone under Organization settings > Products > Claude Code, or for a pilot group (when your organization has a parent organization) under Organization settings > People > Permission policies in the group policy’s Claude Code section. Click Save changes after enabling the switch in either location. Update the claude CLI to 2.1.330 or later; if you also use the VS Code extension, update the extension as well. Sign-in tells Claude Code where to route requests, not how to authenticate upstream: developers still need cloud credentials for AWS, Google Cloud, or Azure, and gateways with their own sign-in require a second /login inside Claude Code (until they do, Claude Code refuses each prompt and tells them what to do).

Check which settings win on your machine

Claude Code resolves settings in a strict three-level priority order, from lowest to highest:

  1. The developer’s own settings files.
  2. Enterprise Admin Console settings downloaded after claude auth login.
  3. The computer’s local Claude Code managed settings (managed-settings.json, a macOS MDM profile, or a Windows registry policy; Claude Desktop configuration profiles and HKCU registry policies do not count).

If even one Claude Code managed setting stays on the computer, the computer ignores your console completely and prints: The organization's settings won't apply on this computer, because the computer's own managed settings take priority.

Admins have two documented options:

  • Remove local managed settings: move supported rules into the console, then delete managed-settings.json, any drop-in files, the MDM profile, or the registry policy for Claude Code while leaving any Claude Desktop configuration profile intact.
  • Keep local managed settings beside the console: keep them only when you need settings the console cannot configure, and add your organization’s ID as forceLoginOrgUUID. The computer then follows your console as well and refuses other organizations; while signed in, the console connection replaces the computer’s, restrictions from both sides add up, and some local managed settings stop applying. Because Claude Code refuses to start a session with ANTHROPIC_API_KEY, ANTHROPIC_AUTH_TOKEN, or apiKeyHelper on a computer that sets forceLoginOrgUUID, leave forceLoginOrgUUID off machines that also need a key for another gateway such as BetterToken.

The console alone cannot require developers to sign in. To require organization sign-in on CLI-only machines after enabling sign-in in the console, add three keys to local managed settings: forceLoginOrgUUID (makes the computer follow your console and refuse other organizations, though it does not require sign-in alone), "enforceAnthropicSignIn": true (write true without quotes; starts cloud or gateway sessions only when signed in to your organization), and "requiredMinimumVersion": "2.1.330" (blocks older versions that ignore enforceAnthropicSignIn). Do not set enforceAnthropicSignIn or requiredMinimumVersion on computers that also run Claude Desktop on your provider: enforceAnthropicSignIn stops Claude Desktop sessions (Code, Cowork, Chat, and scheduled tasks) even when signed in, and requiredMinimumVersion stops Claude Desktop sessions whenever its bundled copy of Claude Code is older than the minimum.

After running claude auth login and selecting your organization in the browser, verify the setup in two steps:

  1. Check that the terminal prints Signed in to the organization. If it prints Login successful. instead, you picked another account and should run claude auth login again.
  2. Close open Claude Code sessions, start claude, and run /status:
    • Setting sources includes Enterprise managed settings (remote).
    • For a cloud provider, API provider names your provider and ends with (chosen by your organization).
    • For a gateway, Anthropic base URL displays your gateway’s address, and no row says that your connection isn't used.
    • Managed settings (remote) appears only if Claude Code has something to tell you: it gives the cause of any problem and names settings in your console JSON that Claude Code ignored.

2.1.330 also shortens the claude.ai sign-in URL printed by /login, claude auth login, and claude setup-token. If the short URL shows an error or a script reads values from it, set CLAUDE_CODE_FULL_SIGN_IN_LINK=1 in your shell or user settings (requires 2.1.330 or later). If a gateway blocks traffic with HTTP 403 or TLS errors after switching endpoints, see our guide to diagnosing Claude Code 403 and TLS errors.

What changes for /loop and 30-day scheduled tasks

In 2.1.330, recurring scheduled tasks and /loop jobs run for up to 30 days instead of 7 days while their session keeps running, and Claude Code now tells you when they end. Two strict conditions apply:

  • The session must stay running: per the scheduled tasks reference, /loop and CronCreate tasks are session-scoped and fire only while Claude Code is running and idle. If a task’s scheduled time passes while Claude is busy on a long-running request, it fires once when Claude becomes idle rather than replaying every missed interval. Closing a regular terminal stops tasks from firing. To keep /loop tasks running after you close your terminal, move the session to the background first with /background (or /bg); Claude Code’s supervisor service keeps background sessions running without a terminal while a pending scheduled task or /loop wakeup is active. Resuming later with claude --resume or claude --continue restores unexpired CronCreate tasks, not a self-paced /loop.
  • Tasks created before 2.1.330 still end at 7 days: upgrading Claude Code does not extend existing schedules.

To move an existing recurring task onto the 30-day limit after upgrading:

  1. Ask Claude to list your tasks in natural language (such as what scheduled tasks do I have?) or via CronList, which shows each task’s 8-character ID, schedule, next run time, and prompt.
  2. Cancel any pre-2.1.330 task in natural language (such as cancel the deploy check job) or by passing its ID to CronDelete.
  3. Recreate the schedule with /loop or a natural-language prompt and confirm the new end time that 2.1.330 displays.

Two related fixes ship in 2.1.330. First, a skipped scheduled task notice that names no organization now tells you to start Claude Code with --resume, because /resume inside a running session does not run the task. Second, in VS Code, forked conversations no longer run the original conversation’s /loop schedules a second time.

Restored max_tokens retry and gateway behavior

If you hit max_tokens failures behind an LLM gateway on 2.1.329, upgrading to 2.1.330 restores client-side recovery. The official Claude Code changelog documents three consecutive changes:

  • 2.1.326 added automatic retry with the maximum reported by the Anthropic API when max_tokens exceeded the model’s limit.
  • 2.1.329 removed that retry and told gateway users whose model accepts fewer output tokens to set CLAUDE_CODE_MAX_OUTPUT_TOKENS manually (see our Claude Code 2.1.329 gateway changelog).
  • 2.1.330 reverts 2.1.329’s removal and restores automatic retry when max_tokens exceeds a model’s or gateway’s limit.

This affects custom model aliases and lower-cap models most directly. Per the Claude Code environment variables reference, any unrecognized model ID defaults to 32000 output tokens with a cap of 128000. According to the gateway compatibility guide, most retry logic matches on upstream error wording, so gateways should forward upstream error response bodies unmodified. Wrapping upstream errors in a custom envelope breaks recovery even when the gateway preserves the HTTP status code.

A normal reply alone does not confirm that automatic retry fired, because the first request may already have fit inside your gateway’s limit. To verify that Claude Code retried at the reported max_tokens limit, inspect gateway logs that expose request fields: look for an initial over-limit request that returns a max_tokens error, followed immediately by a retry carrying the lower max_tokens value from that error. On the BetterToken workspace dashboard, the documented fields cover balance, request time, model, status, input/output/cache token usage, and charges. Those fields can show a failed entry followed immediately by a succeeding entry as a clue, but they do not establish that both requests came from one turn or confirm the retried max_tokens value; rely on gateway logs with request fields for confirmation. If your gateway still returns max_tokens errors on 2.1.330, set CLAUDE_CODE_MAX_OUTPUT_TOKENS as a fallback to the output-token limit accepted by your active model and gateway route, using the lower value when both limits are known. A successful reply with that cap set proves the capped request works, not that automatic retry triggered. If context-window assumptions also conflict behind your gateway, see our guide on fixing unrecognized gateway model limits.

Three other 2.1.330 changes apply to gateway setups:

  • WebFetch /effort behind gateways: fixed WebFetch page summaries ignoring /effort when a gateway refuses the small fast model.
  • Shorter system prompt for unrecognized sonnet/haiku IDs: unrecognized names containing "sonnet" or "haiku" now use the shorter system prompt, like other unrecognized names; set CLAUDE_CODE_SIMPLE_SYSTEM_PROMPT=0 to give every model the full prompt.
  • Lower token use on Claude apps gateway: subagent progress summaries in terminal sessions signed in to a Claude apps gateway are now written from short notes instead of the whole conversation.

Toggle easel charts and silence enterprise MCP warnings

2.1.330 adds easel (cc-plugin-easel in /plugin), a built-in mod that gives Claude a chart-drawing tool and draws charts automatically under MCP results in a supported time-series format, such as a Prometheus range query result. Per the Claude Code changelog and mods overview, easel requires:

  • Sign-in: a claude.ai subscription (Pro, Max, and, where available, Team and Enterprise). It does not load on API-key or third-party gateway sessions.
  • Platform: macOS or Linux outside WSL.

Control easel at two levels:

  • Stop automatic charts only: run /config and turn off Auto charts. Claude can still draw charts when asked.
  • Disable the mod completely: open /plugin, go to the Installed tab under Built-in, and disable cc-plugin-easel. Settings and flags that stop user-installed mods (disableAllHooks, --bare, and --safe-mode) do not stop built-in mods.

If your organization filters MCP access with allowedMcpServers or deniedMcpServers (see Control MCP server access) and excludes the built-in chart tool, 2.1.330 removes a noisy startup bug: Claude Code no longer prints MCP server blocked by enterprise policy: easel at every start. The built-in chart tool stays blocked by enterprise policy.

Confirm-before-risky-actions rumor vs. actual 2.1.330 changes

Third-party release summaries on X, such as @ClaudeCodeLog on November 20, 2026, listed a new “confirm-before-risky-actions policy” as a 2.1.330 highlight. Other developers, including @alexmichael, noted the same day that the policy dated back to 2.1.321.

The official 2.1.330 changelog (CHANGELOG.md and code.claude.com/docs/en/changelog) contains no confirm-before-risky-actions entry. The approval change actually shipped in 2.1.330 is narrower: more rm commands aimed at root, home, a top-level folder, or the working folder now ask for approval, and where nobody can answer, Claude Code refuses them.

Other 2.1.330 stability fixes worth checking

Several reliability fixes in 2.1.330 resolve common day-to-day blockers:

  • Session freezes: fixed multi-minute freezes right after compacting a very long conversation, WebFetch freezes or empty results on some pages, and a three-minute wait on the first prompt after a sleep of two minutes or more on Linux and WSL.
  • Parallel sessions and settings safety: fixed lost user settings when several Claude Code processes saved simultaneously, stopped ExitWorktree and the worktree exit dialog from deleting a worktree active in another running session, and fixed "JSON schema is invalid" failures and multi-megabyte session growth when many MCP tools expose schemas the API refuses.
  • Search, review, and runners: /config search now places most settings whose name starts with what you type first (effort finds Model and dark or light finds Theme); /ultrareview stops and names both folders if the shell moved into another repository, and shows how much of your monthly spend limit is left on Team and Enterprise plans when that is below a typical review cost; self-hosted runners add --start-dir and SELF_HOSTED_RUNNER_START_DIR.
  • VS Code extension: adds /fork, /workflows, and claudeCode.escapeStopsClaude, and fixes copied code blocks adding a trailing newline that ran commands on paste.

Ready to optimize your LLM workflow?

Join thousands of developers building faster, smarter, and more cost-effective AI applications with BetterToken.

Get Started for Free