Playbooks · Coding tasks
Claude Code 2.1.331 brings Code Mode to cloud hosts
Written November 24, 2026
Claude Code 2.1.331 adds Code Mode on Bedrock, Agent Platform, Foundry and Claude Platform on AWS, a doctor API check, and fixes MCP hangs of 30 minutes.
Claude Code 2.1.331 is mainly a cloud and diagnostics release. Code Mode now works in terminal sessions on four hosted platforms where it was not available before. claude doctor can now say whether the API is reachable, which helps separate a network or proxy problem from an authentication problem. The release also fixes a case where an MCP tool call could hang for a long time, and adds gateway, plugin, and telemetry options.
Code Mode in terminal sessions on four cloud hosts
Code Mode is now supported in terminal sessions on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, and Claude Platform on AWS. Before this release, a team running Claude Code against one of those hosts did not have that support in the terminal, even though the same workflow could be used on the first-party API.
For a team already standardized on one of those platforms, this removes a reason to keep a separate setup for Code Mode work. The session still runs against the host the team already uses.
A doctor check for API connectivity
claude doctor now has an API connectivity section. It reports whether the API can be reached, with the HTTP status or the error when it cannot. When the check was not run, it says why it was not tested.
That distinction matters in practice. A proxy that blocks the request, an unreachable endpoint, and a failed sign-in can look similar from the first error message. A direct reachability result gives you a smaller place to start: fix the connection first if it is not reachable, and look at credentials only once it is.
MCP tool calls no longer hang on malformed replies
MCP tool calls no longer hang for up to 30 minutes on some malformed replies from a local or WebSocket server. Previously, a reply in the wrong shape could leave the call waiting for the full timeout instead of failing.
A shorter failure is easier to act on. You see the server's problem sooner and do not lose half an hour to a call that was never going to complete.
Gateway groups and proxy sign-in options
The Claude apps gateway gains oidc.groups_jsonpath, which reads groups from the matching entries of a list of objects using a small subset of JSONPath (RFC 9535). That is useful when an identity provider returns groups inside a list of objects rather than as a flat list of names.
Gateways also gain CLAUDE_GATEWAY_IDP_CONNECT_BY_HOSTNAME=1. With oidc.use_proxy set to true, sign-in requests hand the proxy an https identity provider's hostname, even with NO_PROXY set.
Uncompressed responses behind a cutting proxy
CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSION asks for uncompressed model responses. It is meant for use behind a proxy that cuts compressed responses off, where the compressed stream does not arrive intact.
The release notes advise against using it yet for self-hosted runners or Remote Control. For other setups behind such a proxy, it gives you a specific setting to try instead of replacing the proxy first.
Plugin dependencies that install and remove on their own
Plugin manifests gain optionalDependencies. A plugin listed there installs with the plugin that lists it, and it can be disabled or uninstalled on its own, separately from the plugin that brought it in.
The plugin auto-update notice also changes. It now names plugins newly installed as dependencies separately from updated plugins, so you can see why a plugin you did not install by name has appeared.
Telemetry spans carry usage and model fields
OpenTelemetry trace spans for claude_code.llm_request gain gen_ai.usage.*, gen_ai.response.model, and gen_ai.operation.name. The gen_ai.usage.input_tokens value includes prompt cache tokens.
For teams that already collect these spans, the added fields make usage and model reporting more complete without a separate log source, and input counts that include cache tokens show what a request actually processed.
A notice when tap-mode dictation stops by itself
Tap-mode voice dictation now shows a notice when it stops by itself. That happens after 15 seconds without recognized speech, or at its 2-minute limit.
If input stops, you can now tell whether the limit or the silence timeout ended it, rather than wondering whether the microphone failed.
Fixes for silent replies, compact, plugins, and file ranges
When a reply goes silent while Claude is still thinking, Claude Code now tries the request once more instead of failing the turn, a fix for turns and subagents in cloud sessions and for timeouts on long replies elsewhere.
/compact and auto-compact no longer sometimes lose part of the summary when it quoted certain XML tags. An interrupted plugin update no longer leaves a partial folder that loads with components missing. An @-mention written as @file#10-12 now attaches those lines instead of the whole file. A session started soon after another no longer waits for the model list at startup.
What to do
- If you run Claude Code on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, or Claude Platform on AWS, try Code Mode in a terminal session after updating.
- Run
claude doctorwhen a session fails to connect, and check its API connectivity section before changing credentials. - If a local or WebSocket MCP server returns malformed replies, update so its tool calls fail instead of hanging for up to 30 minutes.
- If your gateway reads groups from a list of objects, set
oidc.groups_jsonpathusing the supported JSONPath subset. - If your gateway uses a proxy for sign-in, consider
CLAUDE_GATEWAY_IDP_CONNECT_BY_HOSTNAME=1withoidc.use_proxyset to true. - If a proxy cuts compressed responses off, try
CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSION, except on self-hosted runners or Remote Control. - If you publish a plugin, use
optionalDependenciesfor plugins that should install with yours but remain removable on their own. - Use
@file#10-12style mentions when you only need those lines of a file attached.
Related playbooks
- Claude Code 2.1.328 makes auto mode the cloud default
- Claude Code 2.1.322: Vertex fast mode, three regions
- Claude Code 2.1.323: Code Mode writes the tool calls
- Antigravity CLI 1.5.4: ACP Auto mode
Sources
- Claude Code v2.1.331 release notes — GitHub — Code Mode support on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry and Claude Platform on AWS, the `claude doctor` API connectivity section, the fix for MCP tool calls hanging up to 30 minutes, the gateway, compression, plugin, telemetry and dictation additions, and the fixes for silent replies, compact summaries, interrupted plugin updates, file line ranges and startup.
Back to: Coding playbooks hub · Also: Claude Code 2.1.330 adds easel charts and org sign-in