Claude Code 2.1.329 Changelog: Gateway max_tokens, /tasks, /code-review, and Fixes
Claude Code 2.1.329 (November 19, 2026) removes automatic max_tokens retries behind gateways, adds scheduled tasks and forks to /tasks, changes /code-review to diff full branches by default, adds hook-source trust warnings, and fixes ~/.claude.json resets plus macOS, VS Code, and usage-credit bugs. Covers upgrade steps, gateway routing options, and key 2.1.328 changes from the same day.
Contents

Claude Code 2.1.329 shipped on November 19, 2026, removing automatic max_tokens retries behind gateways, expanding /tasks, changing /code-review and saved schedules, and fixing ~/.claude.json resets plus macOS and VS Code sign-outs. These changes affect developers in the terminal, VS Code, and Claude Desktop, along with teams using LLM gateways or Pro and Max usage credits. Run claude --version and claude update to upgrade, then set CLAUDE_CODE_MAX_OUTPUT_TOKENS if your gateway enforces a lower output cap.
Choose an access route for Claude Code 2.1.329
Upgrading to 2.1.329 touches gateway output-token limits, self-hosted gateway allow_cidrs warnings, and Pro or Max monthly credit reporting. Compare the realistic routes before changing local or team settings.
| Route | Account and region requirements | Billing unit | When to choose |
|---|---|---|---|
| Claude Pro / Max subscription | Paid claude.ai account (Pro, Max, Ultra, Team, or Enterprise; free claude.ai excluded) in an Anthropic supported region | Included subscription usage plus optional usage credits | You need Remote Control, voice input, or bundled web and CLI usage |
| Direct Anthropic Console API | Claude Console account (platform.claude.com, via API key or Console sign-in) in an Anthropic supported region | Pay-as-you-go per API token | You want direct Anthropic API billing without a proxy |
| Organization or self-hosted gateway | Organization-managed proxy (such as Claude apps gateway with corporate IdP sign-in) plus upstream API or cloud credentials | Billed per token to your upstream Anthropic Console, Bedrock, Agent Platform, or Foundry account | Your team requires central budgets, model access controls, audit logs, and managed settings |
| BetterToken pay-as-you-go API gateway | BetterToken account and console API key; no claude.ai account needed for API access | Pay-as-you-go per token (purchased paid balance does not reset monthly) | You want Anthropic-compatible Claude API access or multi-model choice without hosting a gateway |
Connect Claude Code 2.1.329 to BetterToken
BetterToken is an independent multi-model API platform, not an official Anthropic product. Its Anthropic-compatible Base URL for Claude Code is https://bettertoken.ai. Omit /v1 from ANTHROPIC_BASE_URL, because Claude Code appends /v1/messages automatically.
As of 2026-11-20, BetterToken lists claude-sonnet-5-5, claude-opus-5-5, claude-haiku-5-5, and claude-fable-5-2 on its Anthropic-compatible endpoint (each with a 1M-token context window and 128K maximum output, synchronous on Sonnet 5.5, Opus 5.5, and Haiku 5.5), plus claude-haiku-4-5-20251001 (200K context and 64K maximum synchronous output). Review current prices for live input, output, and cache rates before running heavy sessions.
In Bash, read your API key without echoing it and export the variables for a test session:
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"
export ANTHROPIC_DEFAULT_SONNET_MODEL="claude-sonnet-5-5"
export ANTHROPIC_DEFAULT_HAIKU_MODEL="claude-haiku-5-5"
export ANTHROPIC_DEFAULT_OPUS_MODEL="claude-opus-5-5"
Run a one-shot prompt to confirm the connection:
claude -p "Reply with only: OK"
A plain OK reply without 401, connection, or model errors confirms authentication. Next, start claude and run /status. Confirm that Anthropic base URL displays https://bettertoken.ai and the authentication line shows ANTHROPIC_AUTH_TOKEN instead of a claude.ai login. If startup warns about conflicting credential sources, run /logout to clear the saved claude.ai session and clear ANTHROPIC_API_KEY if your shell sets it.
To persist these values across sessions, add them to the "env" block in ~/.claude/settings.json (%USERPROFILE%\.claude\settings.json on Windows) and fully restart Claude Code. Follow the BetterToken Claude Code setup guide or the Claude Code API setup page for full examples. Add CLAUDE_CODE_MAX_OUTPUT_TOKENS only if you select a model whose output cap is lower than Claude Code’s request size. If you set the optional CLAUDE_CODE_DISABLE_NONESSENTIAL_TRAFFIC=1, automatic updates turn off, so run claude update manually. Remote Control and voice input require a claude.ai login and stay unavailable with an API key and custom base URL.
If your organization already operates its own proxy or Claude apps gateway, keep your managed settings or follow Anthropic’s Connect Claude Code to an LLM gateway guide to set ANTHROPIC_BASE_URL alongside ANTHROPIC_AUTH_TOKEN, ANTHROPIC_API_KEY, or apiKeyHelper.
Gateway max_tokens errors and allow_cidrs startup warnings
Claude Code 2.1.329 removes a retry behavior introduced in 2.1.326. In 2.1.326, when a request’s max_tokens exceeded the model’s limit, Claude Code automatically retried at the maximum reported by the API error. According to the official Claude Code changelog, version 2.1.329 drops that retry.
This change affects teams routing through a gateway to a model that accepts fewer output tokens than Claude Code requests. Per the Claude Code environment variables reference, unrecognized custom model IDs default to 32000 output tokens with a 128000 cap. When a gateway backs that ID with a lower-cap model, requests now fail on max_tokens instead of retrying silently.
Set CLAUDE_CODE_MAX_OUTPUT_TOKENS to your model’s confirmed output cap in your shell or in ~/.claude/settings.json:
export CLAUDE_CODE_MAX_OUTPUT_TOKENS="16384"
Replace 16384 with the model’s actual output limit, restart Claude Code, and send a short prompt to verify the max_tokens error clears. If your gateway rejects requests for input length rather than output length, see our guide on fixing Claude Code 1M context window gateway errors.
Operators running Anthropic’s self-hosted Claude apps gateway also get a repeated startup warning. When access_control.allow_cidrs is empty, 2.1.329 logs a boxed notice on every start: never expose the gateway to the public internet (the boot warning does not appear when the gateway binds to a loopback address with neither trusted_proxies nor public_url set). Per the Claude apps gateway configuration guide, leaving both access_control lists (allow_cidrs and deny_cidrs) empty lets the gateway serve any client address, leaving only your network to restrict who can reach it. That matters because a gateway can push managed settings that run commands on developer machines. Populate access_control.allow_cidrs with your private ranges and keep the gateway and everything in front of it unreachable from the public internet. If a load balancer, port-forward, or tunnel relays traffic, list it in listen.trusted_proxies only when that frontend appends each incoming connection’s address so no developer wrote the last X-Forwarded-For entry. Never list an address or range that developers connect from; omitting a qualifying relay leaves the gateway seeing the relay’s address instead of the client’s. Restart the gateway and confirm the warning clears.
/tasks, saved scheduled tasks, and /code-review behavior
Version 2.1.329 changes how active session work appears in /tasks and how /code-review calculates diffs. Check both before resuming recurring jobs or branch reviews.
Managing scheduled tasks, /loop wakeups, and forks in /tasks
/tasks now displays this session’s scheduled tasks, /loop wakeups, the goal, and this conversation’s forks. Press x to stop any selected item after confirmation. The /tasks header and the footer background counter now combine shells, monitors, MCP calls, agents, workflows, and scheduled tasks into one number.
Older saved schedules require manual action after upgrading. In new signed-in sessions, most scheduled tasks saved by earlier versions must be scheduled again. Running claude --resume on their original session still runs those older tasks. Choosing Exit and stop tasks now stops this session’s scheduled tasks so they do not restart on resume, unless you exit while Claude is responding. To choose between Cloud, Desktop, and /loop schedules, see how to schedule Claude Code tasks.
/code-review default-branch diffs and pull request checks
Running /code-review with no target now reviews the whole branch against the default branch on most models. This update also fixes a bug where /code-review lost the diff on multi-commit branches.
Pull request reviews are stricter too. Previously, /code-review <pr number> could silently review your checked-out local branch instead of the pull request. In 2.1.329, it reads the pull request with gh pr diff or states when it cannot. When gh pr diff fails or is refused, /code-review <pr number> --fix and /code-review given a pull request URL now stop without reviewing.
Two review glitches are also fixed on most models. /code-review no longer stops at a permission prompt to look for a nonexistent ~/.claude/CLAUDE.md, and on most models the findings card no longer displays high for a review that ran at medium.
Hooks trust warnings, MCP diagnostics, and /status
Claude Code 2.1.329 improves diagnostics across folder hooks, remote HTTP MCP servers, managed marketplaces, and Code Mode:
- Folder and managed hooks: The trust dialog now says where a folder’s hooks are declared. In Claude Desktop and other non-interactive hosts, failed hooks in managed settings now warn inside the conversation. In VS Code, declining the trust prompt adds a line above the message box with Review trust, letting you reopen it without reloading the window. To audit unexpected project hooks or remote MCP servers, use our guide to auditing hooks and MCP connections in Claude Code.
- Remote HTTP MCP diagnostics: A server’s page in
/mcpadds a Server message row showing the JSON-RPC error when a remote HTTP MCP server refuses the connection. Version 2.1.329 also reconnects most HTTP MCP servers left on an older protocol version so background MCP tasks stop stalling. It fixesclaude mcp loginand/mcpsaying a service does not accept sign-ins from Claude Code when the service’s client registration was retired (HTTP410 Gone), and prevents an active token refresh from re-signing in a server after you cleared its auth. - Marketplace auto-update status:
/statusadds a Marketplace auto-update row naming managed marketplaces that get no automatic updates and explaining why. - Code Mode telemetry and hooks: You can now turn on Code Mode while OpenTelemetry events and metrics are enabled; each tool call sends its events, while tracing still keeps Code Mode off. Code Mode also starts now when telemetry, nonessential traffic, or feature flags are turned off, though an administrator can keep it off in managed settings. A failing
PreToolUsehook no longer refuses a Code Mode script’s tool call unless you set"onFailure": "block"on a command, HTTP, or MCP tool hook. Code Mode now refuses line-range reads over 256 MiB and stops runaway loops before they fill memory.
Fixes for ~/.claude.json resets, sign-outs, and usage credits
Among the 91 bug fixes listed in the 2.1.329 changelog, four reliability fixes resolve frequent session disruptions.
First, ~/.claude.json no longer resets to defaults when a network stall or file lock makes it unreadable and clears it during a save. Upgrading protects future writes, but you still must restore or reapply settings if an earlier build already wiped your file.
Second, macOS and VS Code sign-out loops are fixed. On macOS, login renewal now tests Keychain writes with a Claude Code-write-check item. When Claude Code can read the Keychain but cannot save to it, only that session stops at expiry with a reason while other sessions stay signed in. In VS Code, a 10-to-30-second token refresh delay no longer signs you out across every window and terminal at once. Early community notes on X, such as @alexmichael’s post (2026-11-19 22:17 UTC), highlighted these sign-out and ~/.claude.json fixes alongside /tasks and /code-review, matching the official changelog.
Third, Pro and Max usage-credit checks work more reliably. /usage-credits no longer asks Pro and Max users to log in again after opening the browser. The link also stops disappearing after 8 seconds when the browser fails to open and a task pauses for credits. In addition, /usage no longer says usage credits are off when they ran out or hit the monthly limit, and /model now tells Pro and Max users when that limit blocks a credit-backed model. When subscription limits pause an active task, use our Claude Code usage limit recovery workflow to save a Git checkpoint before switching routes.
Fourth, two editor bugs are fixed. Accepting a diff through the IDE no longer strips a file’s trailing newline or drops its byte order mark (BOM) in VS Code. /terminal-setup also stops corrupting VS Code settings or keybindings around block comments, and stops reporting success while losing the Shift+Enter binding when keybindings.json has an unclosed string.
Also shipped November 19: key changes in Claude Code 2.1.328
Anthropic published v2.1.328 earlier on November 19, 2026 (01:14:04Z), roughly 21 hours before v2.1.329 (22:14:41Z). Teams upgrading directly from 2.1.327 to 2.1.329 also pick up these 2.1.328 updates:
- Gateway timeouts and beta headers:
CLAUDE_STREAM_IDLE_TIMEOUT_MSnow extends the 5-minute connection limit on gateways, custom base URLs, and cloud providers. Auto mode no longer fails every turn outside Claude Desktop whenCLAUDE_CODE_DISABLE_EXPERIMENTAL_BETASis set behind a gateway that rejects betas, or on Bedrock, Agent Platform, Foundry, or Claude apps gateway. MCP tools whose input schemas start withanyOf,oneOf, orallOfno longer disappear on third-party providers or when telemetry or feature flags are turned off. - Focused
/code-reviewreports: On most models,/code-reviewnow reports only bugs andCLAUDE.mdviolations; run/simplifyfor reuse and cleanup suggestions. On most models, it marks each findingImportant,Pre-existing, orNit, ends each summary with a suggested fix, and prints"Code review found no issues."when clean. - Scheduled task protection and MCP hooks: Saving a scheduled task no longer erases other project tasks when the tasks file is unreadable on third-party providers or when telemetry or feature flags are turned off. In addition,
mcp_toolhooks now support"onFailure": "block"alongside command and HTTP hooks.