Claude Code v2.1.331: Code Mode in cloud-provider terminals and a retry on silent replies#
Published by Alex Sorokoletov
Part of the Claude Code Version Tracker series. | Official Env Vars | Official Changelog
Claude Code 2.1.331 runs Code Mode in terminal sessions on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry and Claude Platform on AWS, and it retries a model request once when a reply goes silent, which was behind cloud-session turns failing and long replies timing out elsewhere.[1] It is the first build tracked here since 2.1.324, so this covers the 2.1.325 through 2.1.331 window.
Code Mode runs on the cloud providers#
Terminal Code Mode, in which Claude writes a script that calls its tools, now runs on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry and Claude Platform on AWS.[1] It gained two more footholds earlier in the window: 2.1.326 lets it run with agent teams on, and starts a teams session in Code Mode for anyone who had already turned it on,[5] and 2.1.329 lets it run while OpenTelemetry events and metrics are enabled, with each tool call the script makes sending its own events.[3]
Several 2.1.331 fixes smooth it out. A session resumed with --resume or --continue keeps its thinking and prompt cache; a long script output no longer loses its middle, and Claude gets a path to the uncut text; --bare now tells Claude what its scripts can call; and a ! or slash command typed while a script runs no longer triggers a request about every second.[1]
easel draws charts#
Version 2.1.330 adds easel, a built-in mod that draws charts when asked and under MCP metrics results.[2] It is available on Pro and Max, and where available Team and Enterprise, on macOS and Linux, and automatic charts can be turned off in /config.[2]
Recovery and connectivity#
The retry on a silent reply is the window's main reliability change: when a reply goes quiet while Claude is still thinking, Claude Code sends the request once more.[1] Beside it, MCP tool calls no longer hang for up to 30 minutes on some malformed replies from a local or WebSocket server, a rewind no longer deletes files after a restore has failed, and /compact no longer loses part of the conversation summary when the summary quotes certain XML tags.[1] Back in 2.1.325, a security issue in how zstd-compressed responses are decoded was fixed.[6]
claude doctor gains an API-connectivity section that reports whether the API can be reached, with the HTTP status or the error, or says why it wasn't tested.[1] The claude_code.llm_request trace spans also carry gen_ai.usage.*, gen_ai.response.model and gen_ai.operation.name, and the usage input-token count now includes prompt-cache tokens.[1]
New environment variables#
| Variable | What It Does |
|---|---|
CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSION | Added in 2.1.331. Asks the API for uncompressed model responses, for a proxy that cuts compressed ones off. The changelog notes it is not advised yet for self-hosted runners or Remote Control. |
CLAUDE_CODE_DISABLE_DEFERRED_TOOL_RESUME | Added in 2.1.328. Lets a host stop claude -p --resume and --continue from running a tool call that a hook deferred. |
CLAUDE_CODE_FULL_SIGN_IN_LINK | Added in 2.1.330. Set to 1 to print the full sign-in link, for when the short one shows an error or a script reads values from it. |
The window hardens unattended and cloud runs#
Across these seven releases Code Mode moved from a feature you switch on into one that runs beside agent teams, under OpenTelemetry, and on the major cloud providers' terminals. The reliability work points at the same places a person is not watching: the single retry rescues a cloud-session turn that would otherwise fail in silence, CLAUDE_CODE_DISABLE_DEFERRED_TOOL_RESUME hands a host a switch over what a resumed -p run may do, and CLAUDE_CODE_DISABLE_RESPONSE_COMPRESSION keeps a proxy from cutting a response off. A run with no operator at the keyboard gains the most from this build.
This analysis is conducted for educational and research purposes under fair use principles. All trademarks and software referenced belong to their respective owners.
Sources#
- Claude Code Official Changelog, v2.1.331 release notes
- Claude Code Official Changelog, v2.1.330 release notes
- Claude Code Official Changelog, v2.1.329 release notes
- Claude Code Official Changelog, v2.1.328 release notes
- Claude Code Official Changelog, v2.1.326 release notes
- Claude Code Official Changelog, v2.1.325 release notes
Related Versions#
- Claude Code v2.1.324: sandboxed Bash prompts and a /login privacy prompt
- Claude Code v2.1.323: Code Mode, hook heartbeats, background sign-in fixes
- Claude Code v2.1.321: Fable 5.2 default, MCP OAuth secret-leak fix, Bash permission fixes
- Claude Code v2.1.319: background MCP tasks, auto-denied permission prompts
Previous Claude Code analysis: v2.1.324 (November 15, 2026)
All 91 Claude Code analyses: Claude Code Version Tracker · Official Claude Code changelog