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

Claude Code v2.1.325 Update: Security Fixes and UX Improvements

Claude Code v2.1.325 Update: Security Fixes and UX Improvements

Claude Code v2.1.325 fixes a zstd security issue and tightens default sandbox permissions.

Claude Code has released the v2.1.325 maintenance version, centered on security and stability. The update fixes a security issue in the decoding method for zstd-compressed responses, and developers are advised to upgrade promptly. In terms of terminal and IDE experience, the VS Code integrated terminal shows a one-time prompt to re-run cells after Claude reads or writes a Jupyter notebook, and when an organization policy blocks a request, the error message includes guidance to run `/rewind` or `/clear`. The permission model has been noticeably tightened: sandboxed Bash commands go through the normal permission flow by default, prompt-free execution requires explicitly setting `sandbox.autoAllowBashIfSandboxed`, read-only git commands in non-project or untrusted repositories require confirmation, and skill invocation and `.claude` writes in additional directories are more strictly constrained. It also fixes subagents' independent models being incorrectly switched, token estimation mistakenly using the main session model, and multiple MCP and platform-related issues.

Claude Code has released v2.1.325. Although the version number change is modest, the content is substantial — from security fixes to terminal experience improvements to more granular permission model adjustments, it touches multiple aspects of developers' daily usage.

Claude Code v2.1.325 release page

Security Fix: zstd Decoding Issue

This update first addresses a security issue: the decoding method for zstd-compressed responses. Although the release notes do not elaborate on vulnerability details, the wording suggests this is a low-level issue requiring priority handling. For developers who rely on Claude Code to process network requests, upgrading promptly is necessary.

zstd (Zstandard) is a lossless data compression algorithm open-sourced by Facebook, striking a good balance between compression ratio and decompression speed. It is commonly used for response compression at the HTTP transport layer (e.g., Content-Encoding: zstd). Compared with gzip and brotli, zstd decompresses faster and achieves better compression ratios at high compression levels, so an increasing number of API gateways and CDNs support it.

When a client decodes a zstd response, it must strictly validate metadata such as frame headers, content size fields, and window size. If there is a lack of bounds checking on declared sizes or window parameters, a maliciously or abnormally constructed compressed stream could trigger uncontrolled buffer allocation, causing memory exhaustion or even more severe consequences. This is also why such "decoding method" issues are typically classified as security issues.

Terminal and IDE Experience Improvements

A new spinner hint has been added in VS Code and similar integrated terminals: after Claude has read or edited a Jupyter notebook, it will prompt the user to re-run notebook cells. This hint is shown only once to avoid repeated interruptions.

Additionally, when an organization policy blocks a request, the error message now directly tells the user how to proceed — run /rewind to modify the message, or run /clear to start over. This "error-as-guidance" design reduces user confusion when encountering blockers.

Permission and Sandbox Model Adjustments

This version makes several noteworthy changes to the sandbox and permission flows:

  • Sandboxed Bash commands now go through the normal permission flow by default; to run without prompts, set sandbox.autoAllowBashIfSandboxed: true.
  • Read-only git commands will prompt first in non-project repositories or untrusted repositories; to run without prompts, explicitly add the directory via --add-dir.
  • Scheduled tasks and /loop will prompt before running skills that declare allowed-tools or hooks, unless Skill(name) is added to permissions.allow.
  • The sandbox now refuses writes to .claude settings, skills, agents, commands, and hooks in additional directories, consistent with the behavior for the startup folder.

Overall, these changes tighten default permissions and turn "no prompt" into an option that requires explicit configuration. Teams accustomed to the previous behavior may need to check their managed settings.

Sandbox is an isolation mechanism used by Claude Code when executing Bash commands. It typically leverages OS-level capabilities (such as seccomp/namespaces on Linux, Seatbelt on macOS) to restrict the filesystem paths, network, and system calls accessible to commands. The core value of the sandbox is that even if the model generates risky or incorrect commands, their impact is constrained within predictable boundaries.

Historically, being "wrapped in a sandbox" was often considered safe enough to skip per-command permission confirmation; v2.1.325 changes this default assumption — the sandbox only reduces risk, and does not mean the command's intent is correct, so the permission flow still applies. Switches like sandbox.autoAllowBashIfSandboxed turn "trust the sandbox = no confirmation" from a default behavior into a policy choice that teams must explicitly declare, making it easier to balance security and efficiency according to each team's risk preferences.

Subagent and Model Handling Fixes

Many subagent-related issues have been fixed: subagents with their own models will no longer be moved to the plan-mode model due to opusplan or haiku settings; subagents with different models no longer incorrectly use the main session's model when estimating file reads and MCP results.

Another improvement worth noting: when a subagent is truncated due to output token limits, it is now asked to provide the complete answer again in a more concise form, rather than returning only the ending portion.

Subagent is an independent agent instance spawned by the main session in Claude Code to handle specific subtasks, such as code search, test runs, or solution planning. Each subagent can be bound to its own model configuration, enabling a division of labor between cost and capability: the main session uses a strong model for decisions, while subagents use lighter models for retrieval and execution.

opusplan is a model configuration tier in Claude Code, typically meaning using an Opus-level model during the planning phase and a more economical model during the execution phase. The problem was that when a subagent explicitly specified an independent model, the global opusplan or haiku settings should no longer "hijack" it into the plan-mode model; similarly, token estimation should use that subagent's own model basis rather than the main session's model. A mismatch in estimation basis directly distorts context budget judgments, which in turn affects truncation and compaction strategies.

Other Notable Fixes

  • Fixed an issue where the most recent turns were occasionally lost when resuming a session.
  • Fixed an issue where Active days in /stats was overcounted by one day.
  • Fixed an issue where /insights incorrectly indicated the report was ready when no sessions met the analysis criteria.
  • Several MCP-related issues have been addressed, including stuck tasks, residual authentication state, and interrupted background task updates.
  • Windows and Linux each have targeted fixes, such as Windows startup lag and errors in the Linux sandbox under symlinked home directories.

MCP (Model Context Protocol) is an open protocol proposed by Anthropic to let models connect to external tools and data sources in a standardized way. MCP servers can provide tools, resources, and prompt templates. In Claude Code, MCP connections are long-lived: they need to maintain authentication state, heartbeats, and background tasks, and be rebuilt when a session is resumed.

For this reason, MCP-related defects often manifest as state-machine issues such as "stuck tasks," "residual authentication state," and "interrupted background updates," rather than single-call failures. Residual authentication is particularly insidious — credentials or connection handles from old sessions that are not cleaned up may cause subsequent requests to hit stale contexts. Although such fixes are inconspicuous, they directly determine stability in multi-tool collaboration scenarios.

Conclusion

v2.1.325 is a maintenance release focused primarily on stability and security. The tightening of permission defaults, correct handling of subagent models, and a large number of MCP and terminal experience fixes all point in the same direction: making Claude Code more predictable in complex engineering environments. After upgrading, it is recommended to check sandbox- and permission-related configurations to ensure your team's workflows are not affected.

One-line Summary

Claude Code v2.1.325 fixes a zstd security issue and tightens default sandbox permissions.

Paragraph Summary

Claude Code has released the v2.1.325 maintenance version, centered on security and stability. The update fixes a security issue in the decoding method for zstd-compressed responses, and developers are advised to upgrade promptly. In terms of terminal and IDE experience, the VS Code integrated terminal now shows a one-time prompt to re-run cells after Claude reads or writes a Jupyter notebook, and when an organization policy blocks a request, the error message includes guidance to run /rewind or /clear. The permission model has been noticeably tightened: sandboxed Bash commands go through the normal permission flow by default, and prompt-free execution requires explicitly setting sandbox.autoAllowBashIfSandboxed; read-only git commands in non-project or untrusted repositories require confirmation first; skill invocation and .claude writes in additional directories are also more strictly constrained. In addition, it fixes issues where subagents' independent models were incorrectly switched, token estimation mistakenly used the main session model, and various MCP and platform-related issues.

#Claude Code#v2.1.325#zstd security fix#sandbox permissions#subagent model#MCP
Share:

Related articles