Claude Code 2.1.273: Five New Gateway Headers and a Classifier Flip on Bedrock, Vertex, and Foundry

Claude Code 2.1.273 ships opt-in gateway hint headers exposing request class, agent type, and compaction state to any LLM proxy. It also flips the auto mode classifier to local-only on Bedrock, Vertex AI, and Foundry — only one change has a revert path.

TheRouter Newsroomvia Anthropic
Claude Code 2.1.273 gateway hint headers and auto mode classifier change illustrated as a proxy observability dashboard showing request classification signals

Claude Code 2.1.273 shipped on September 15 with a change that every operator running an LLM gateway should enable immediately — and a second change, to the auto mode classifier on AWS Bedrock, Google Vertex AI, and Azure Foundry, that is already in effect whether you want it or not.

These two changes share nothing in architecture, but they interact in practice: if you want to observe what your auto mode sessions are doing after the classifier change, the new headers are how you do it.

Five headers that tell your gateway what Claude Code is doing

Set CLAUDE_CODE_GATEWAY_HINT_HEADERS=1 and Claude Code starts sending five additional request headers on every turn:

HeaderWhat it contains
x-claude-code-request-classauto, default, fast, or plan
x-claude-code-agent-typeuser, background, or subagent
x-claude-code-prev-tool-durationsJSON array of elapsed ms for the previous turn's tool calls
x-claude-code-compactiontrue if this request is the compaction summarizer turn
x-claude-code-context-compactedtrue if the context was compacted before this turn

These are hint headers — Claude Code emits them, and what the gateway does with them is up to you. The practical uses are significant.

Request-class routing: A gateway can apply separate rate limits, cost budgets, or provider selections for auto vs. default sessions. An auto mode agent running a multi-step tool loop and a developer in interactive mode have very different latency tolerances and cost profiles. Today most gateways treat them identically because the headers did not exist. Now they don't have to.

Agent type tagging: background and subagent turns are spawned by Claude Code's agent orchestration layer, not by a human typing. Tagging these separately in your observability stack lets you separate agent spend from interactive spend without modifying any application code.

Compaction awareness: When x-claude-code-compaction: true, the request is a summarization call that rewrites long context into a compact form. These are structurally different from normal generation requests — often shorter input, always prose-heavy output — and they fire infrequently but on a cost cliff. Knowing which turns are compaction turns lets you route them to a cheaper model or flag the cost event in billing systems.

Tool duration telemetry: The x-claude-code-prev-tool-durations header arrives on the turn after a tool loop completes. Gateways that want to correlate latency between tool calls and subsequent LLM turns now have the raw data in the header without a side channel.

The headers are off by default and opt-in. They add a small amount of data to every request — negligible in practice, but the off-by-default decision means existing gateway installs are unaffected until you enable them.

The classifier flip on Bedrock, Vertex, and Foundry

Auto mode in Claude Code uses a classifier to decide whether a given action needs user approval. Before 2.1.273, that classifier defaulted to server-side on all platforms. In 2.1.273, the default on Bedrock, Vertex AI, and Foundry silently flips to the local classifier.

Anthropic's release note is brief: "Changed auto mode on Bedrock, Vertex and Foundry to use the local classifier by default for now." The "for now" framing suggests this is a stability fix — the server-side classifier was apparently producing unexpected results on requests that transit third-party platform endpoints. Whatever the reason, the behavioral consequence is real.

The local classifier runs on the client, uses the same model weights as the server-side classifier, but does not have access to the latest server-side tuning that Anthropic ships independently of Claude Code releases. If your teams depend on Anthropic's server classifier for auto mode governance — particularly for approval-bypass decisions — they are now running on an older decision boundary on those three platforms.

To revert: set CLAUDE_CODE_AUTO_MODE_SERVER=1 to force server-side classification. This is the explicit revert path Anthropic documented in the changelog.

Who is affected: any team running Claude Code auto mode through AWS Bedrock, Google Vertex AI, or Azure Foundry without an explicit CLAUDE_CODE_AUTO_MODE_SERVER=1 setting. Direct API (via ANTHROPIC_API_KEY) and Claude apps gateway sessions are unaffected — they still default to server-side.

2.1.271: per-command domain allowlisting and org policy freshness

Two changes from 2.1.271 that also arrived in this batch deserve attention:

Per-command allowed_domains in auto mode with sandboxing: Bash, PowerShell, and Monitor tool calls can now declare the specific hostnames they need. The gateway reviews them with the command, opens those hosts for that command only, and blocks other hosts. This is a tighter sandbox posture for organizations that want outbound domain control without writing blanket deny rules. It does not apply to sessions without sandboxing enabled.

Org policy cache bug: In earlier versions, a cached org policy could persist after switching accounts, organizations, or API keys mid-session. The policy would not refresh until the hourly background check. This bug could cause sessions running under a stale org policy — with the wrong set of allowed tools or models — after a credential rotation. 2.1.271 fixes it: policy now invalidates when the credential changes.

For gateways that cycle API keys as part of credential rotation, this bug meant that Claude Code sessions could be operating under the previous credential's policy envelope for up to an hour. With the fix, that window closes immediately.

The billing multiplier for chargeback teams

2.1.271 also extends modelPricing in managed settings (and the pricing: block in Claude apps gateway config) to accept a multiplier above 1, up to 10. This is a markup factor for internal chargeback: if your org bills teams at 3× API cost to cover overhead and margin, set multiplier: 3 and /cost reports and OTEL telemetry will output fully loaded costs automatically. Previously, operators running internal showback models had to apply the markup in their billing pipeline after export.

The multiplier applies uniformly across models in the configured pricing block. It does not affect what Anthropic charges — it adjusts what your internal /cost UI and telemetry surface report.

What to check in your gateway config

  • Enable CLAUDE_CODE_GATEWAY_HINT_HEADERS=1 on any gateway-proxied Claude Code install. The headers are additive and backward-compatible with existing proxies — headers unknown to the gateway are forwarded or dropped without error.
  • Audit Bedrock, Vertex, and Foundry deployments for auto mode usage. If server-side classifier consistency matters for your approval governance, add CLAUDE_CODE_AUTO_MODE_SERVER=1 to those sessions explicitly.
  • Check for credential rotation workflows that relied on hourly org policy refresh. With the policy freshness fix live, sessions now pick up the new policy immediately on credential change — which is the correct behavior, but may surface policy differences that were previously masked.
  • Test allowed_domains in sandbox mode if you're running auto mode with network sandboxing. Per-command domain declarations are now the right way to express outbound network needs for specific tools.

The hint headers require no gateway-side changes to begin receiving — you can start logging them the moment you set the env var. What you route on is your call.

Help & contact