[KongchangAI]
· 2 min read· 1,370 words

Claude Code v2.1.328 Update: Bedrock Auto Mode and Numerous Stability Fixes

Claude Code v2.1.328 Update: Bedrock Auto Mode and Numerous Stability Fixes

Claude Code v2.1.328 adds multi-platform auto mode, stabilizes self-hosted runners, and fixes numerous Code Mode and terminal issues.

Claude Code v2.1.328 is a polish-focused release with no disruptive features. Key changes: auto mode for Opus 4.6 and Sonnet 4.6 on Amazon Bedrock, Google Cloud Agent Platform, Microsoft Foundry, and Claude apps gateway, defaulting for interactive sessions without a permission mode; `mcp_tool` hook gains `"onFailure": "block"`, consistent with command and HTTP hooks. Self-hosted runners get `--repository-folder`, `--hook-label`, `--metadata` parameters and two new queue/abandoned-session metrics, plus fixes for empty proxy responses, clock rollback token expiration, lost objects after temp disk errors, and more. Code Mode removes the 0.75s post-script pause, shows running commands and output, and fixes top-level await/return and read-only subagent write tool exposure. Terminal and cloud sessions also fixed zsh `=` word errors, Esc loss, Markdown rendering freezes, lost compaction summaries, and unreachable cross-session messages.

rss source: v2.1.328

Claude Code has released the v2.1.328 update, which focuses on platform compatibility, self-hosted runner stability, and interaction improvements in Code Mode. While it doesn't introduce revolutionary features, it fixes a large number of detail issues that affect daily use—worth noting for teams relying on Claude Code for development.

Cross-Platform Auto Mode and Hook Enhancements

The most notable change in this update is the addition of auto mode for Claude Opus 4.6 and Sonnet 4.6 on Amazon Bedrock, Google Cloud's Agent Platform, Microsoft Foundry, and the Claude apps gateway. Interactive sessions that haven't set a permission mode will now default to this mode, reducing the configuration burden for multi-platform users.

The hooks mechanism has also been enhanced. The mcp_tool hook now supports "onFailure": "block" configuration, consistent with command hooks and HTTP hooks, meaning subsequent operations can be blocked when a hook call fails. Additionally, when a session skips permission prompts, the system now issues a warning that messages may be held or dropped by the cloud session. In /status and claude doctor, a hint is also displayed if the OpenTelemetry exporter has no endpoint configured, preventing silent data loss.

Auto mode and permission modes: Claude Code's permission mode determines whether tool calls (such as reading/writing files or executing commands) require per-item user approval before execution. Common modes include the default interactive confirmation, bypassPermissions (skipping confirmation entirely), and read-only planning modes like plan. Auto mode is a middle ground: it reduces repeated pop-up interruptions while maintaining certain safety boundaries, suitable for teams that already trust their project environment and want to improve efficiency. Extending auto mode to third-party platforms like Amazon Bedrock and Google Cloud Agent Platform means sessions on these platforms that don't explicitly set a permission mode will also default to this path, resulting in more consistent behavior—but teams should confirm in advance whether this mode is acceptable under their compliance requirements.

Hooks and "onFailure" semantics: Hooks are external commands or HTTP requests that Claude Code automatically executes at specific lifecycle events (such as before tool calls, at session start, or when permission prompts are skipped), commonly used for audit logging, policy validation, or enterprise gateways. The "onFailure" field controls how failures of the hook itself (e.g., a command returning non-zero, or an HTTP request error) are handled: setting it to "block" prevents subsequent operations intercepted by the hook from continuing—essentially "fail-closed"—suitable for security validation hooks; leaving it unset tends toward allowing the operation, i.e., "fail-open," suitable for logging hooks. The mcp_tool hook previously lacked this option; now that it's been added, all three hook types have consistent failure semantics, making it easier to configure policies uniformly.

Self-Hosted Runners: Finer Control and More Robust Failure Handling

Self-hosted runners are the main focus of improvements in this update. A new --repository-folder parameter allows specifying a repository folder name for sessions when using --capacity 1, replacing the path under the base folder (which must not be a symlink). The --hook-label and --metadata key=value parameters let orchestrators pass labels to the spawn-runner hook, providing more granular control over session management.

On the observability side, two new metrics have been added: claude_code_self_hosted_orchestrator_session_queue_wait_by_reason_seconds and claude_code_self_hosted_orchestrator_sessions_given_up_total, helping operators distinguish session wait reasons and count the number of times runner spawning was abandoned.

The fixes are equally dense: resolved an issue where proxies or web filters returning HTTP 200 with an empty {} response body caused all running sessions to be stopped; fixed the case where cloned objects or references were deleted after a temporary disk error; fixed runners stopping due to token expiration when the host clock slows down or is set back; and fixed sessions losing their task list when restored in a new configuration directory. These fixes significantly improve reliability in self-hosted scenarios.

Self-hosted runners and orchestrators: A self-hosted runner is a process deployed on the user's own infrastructure that receives tasks from an orchestrator, launches Claude Code sessions, and returns results—suitable for scenarios where code cannot leave the internal network or needs integration with internal CI/permission systems. --capacity controls how many sessions a single runner can host simultaneously; --repository-folder specifies a concrete repository directory when capacity is 1, allowing the same machine to isolate sessions by repository; the spawn-runner hook triggers when a runner is launched, and --hook-label and --metadata key=value pass labels and key-value pairs through to that hook, facilitating routing, billing, or auditing at the orchestration layer. The two new Prometheus-style metrics count "queue wait time by reason" and "total sessions given up on spawning" respectively—key signals for diagnosing capacity shortages and scheduling failures.

Code Mode Interaction and Performance Improvements

Code Mode received numerous fixes and experience improvements in this update. In auto mode and bypass-permissions mode, the 0.75-second pause after script execution has been removed, improving speed. Code Mode now also displays the commands being executed and their output while the script runs, giving developers clearer visibility into the execution process.

Edit operations have become smarter: edits that produce no actual changes no longer interrupt the script, and failed edits inform Claude of the matching location or the closest location. When a script fails, Claude is told which tool calls are still running. Scripts using top-level await and return, as well as scripts starting with a { block, were previously incorrectly rejected—this is now fixed. Also fixed: silent use of undefined when top-level variables are undefined, and read-only subagents being provided with write() and edit() tools.

Code Mode and top-level await/return: Code Mode allows Claude to orchestrate multiple tool calls by writing and executing scripts rather than issuing them one by one, combining multi-step operations like "read file—modify code—run tests" into a single execution. Scripts are typically wrapped in an async function body, so top-level await is a reasonable pattern; earlier implementations incorrectly rejected such scripts as invalid syntax or silently used undefined for undefined variables, making failures hard to diagnose. This fix allows top-level await, return, and scripts starting with { to execute properly, and prevents read-only subagents from receiving write()/edit() tools—a tightening and correction of execution sandbox semantics.

Terminal and Editor Experience Fixes

Terminal environment fixes cover several common pain points. Words starting with = in zsh (such as echo ==== or [ a == b ]) no longer cause "not found" errors, and =cmd no longer expands to a command path. Auto-compaction no longer reuses the session's earlier system prompt but rebuilds it like the /compact command. Issues with rendering freezes caused by long or malformed Markdown input, and rare screen freezes, have been fixed.

The frequent loss of Esc presses during permission prompts or questions has been fixed; in terminals that send Alt and key presses, unused Alt or Option keys now reject the operation. The issue where slow connections split pastes or terminal replies into two parts that get entered into the prompt has also been resolved. Linux issues with Ctrl+V losing clipboard images, pasting old images, or hanging, as well as full-screen mode copy including quote bars and line breaks losing spaces, are all on the fix list.

Cloud Session and Remote Control Stability Improvements

For cloud sessions, an issue where restored cloud sessions could lose compaction summaries or recent messages when messages were saved late has been fixed. When usage credits run out mid-response, the error message was incorrectly labeled as a rate limit—this has been corrected. Issues with duplicate disconnect messages in remote control sessions and lost pending permission prompts due to restarts when services are slow have also been addressed.

Cross-session messaging has also been improved: newly launched cloud and remote control sessions, or those with @ in their titles, were unreachable when cross-session messaging was used in sessions with remote control enabled—this has been fixed. Claude was previously told that cloud sessions can never reply; it will now know when it can receive replies and how to obtain results.

Summary

v2.1.328 is a typical "polish" release—no disruptive features, but a large number of solid fixes across self-hosted runners, Code Mode, terminal interaction, and cloud session stability. For teams using third-party platforms like Amazon Bedrock or self-hosted deployments, auto mode and metric enhancements reduce operational complexity; for developers working in terminals daily, input and rendering fixes directly improve fluidity.

rss source: v2.1.328

#Claude Code#v2.1.328#Bedrock auto mode#self-hosted runner#Code Mode#terminal fixes#cloud sessions
Share:

Related articles