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

Claude Code v2.1.327 Update Review: MCP Security and Terminal Experience Fixes

Claude Code v2.1.327 Update Review: MCP Security and Terminal Experience Fixes

Claude Code v2.1.327 is fix-focused, strengthening secret security, configuration observability, and session reliability.

Claude Code v2.1.327 is a fix-focused update centered on four areas. For secret security, it adds `claude mcp add-json` to read configuration from standard input, keeping tokens out of command-line history, and fixes accidental deletion of top-level keys in `.mcp.json` under project scope. For observability, `/status` centrally lists hidden failures such as broken files, keybinding errors, and unavailable sandboxes, while `/config` flags overridden settings and fixes silent save failures. At the session level, it fixes multiple message-loss scenarios such as crashes, killed processes, and forgotten remote messages, and lets sub-agents use their own context limits and models. Terminal rendering and Linux startup stability also receive dense fixes, along with boundary protections for extreme inputs such as very long URLs and large numbers of @ mentions.

MCP Configuration and Secret Security

This update adds the claude mcp add-json <name> - command, which supports reading server JSON configuration from standard input. The purpose of this design is straightforward: sensitive information such as tokens no longer has to appear in command-line history, reducing the risk of leakage. Note that this command is not available inside a Claude Code session; it is a tool for external configuration scenarios.

In addition, the behavior of claude mcp add and claude mcp remove under project scope has been fixed so they no longer accidentally delete other top-level keys in .mcp.json, such as $schema or other tools' servers configuration. According to the official changelog, such accidental deletions previously broke configuration files shared across multiple tools. Similar security hardening includes: for commits with new models and in PowerShell environments, Claude is now explicitly told not to commit files that appear to contain secrets.

MCP (Model Context Protocol) is an open protocol that lets model clients like Claude connect to external tools and data sources in a standardized way, such as databases, file systems, or third-party APIs. Each MCP server requires a configuration describing the launch command, transport method (stdio or https), and authentication information. Claude Code typically stores these configurations in a project-level .mcp.json file. Because the configuration often carries API tokens, the configuration file itself becomes a sensitive asset. Top-level keys such as $schema are used for editor validation and hints, and when multiple tools share the same configuration, other tools' own servers sections also need to be preserved. Understanding this is necessary to see why accidentally deleting top-level keys can break other tools' integrations as well.

Observability: Improvements to /status and /config

Troubleshooting environment issues has always been a pain point for terminal tools. This time /status adds a list that centrally displays broken agent, skill, command, and output style files, as well as keybinding errors, unavailable sandboxes, ignored permission settings, and hook matchers that will never match. For team projects with complex configurations, this makes hidden failures visible.

/config has similar improvements: when a setting is overridden by another source, the interface now gives a hint; it also fixes the issue where setting saves failed without a warning, and now the hint line below clearly explains it. Such changes may seem minor, but they can significantly reduce the confusion of "I changed the config but it didn't take effect."

Fixes for Session Recovery and Multi-Session Collaboration

A considerable portion of the changelog revolves around session recovery. Several fixes target message loss after a process is terminated, crashes, or is moved to the background, including: duplicate sending of messages with the same UUID causing stored messages to be lost, loss of answers when recovering a session after an empty reply or a killed command, and remote messages sent after pressing Stop during a restart being forgotten. For long-running sessions, these fixes reduce the probability of "context fragmentation."

Multi-agent scenarios also received targeted adjustments. Sub-agents now use their own context limits and models instead of inheriting the main agent's limits; when a completed sub-agent is resumed, it no longer adopts a sibling agent's model and effort; and when a background agent waits for a long time on a permission prompt, the main conversation can now correctly learn its status. The official changelog also mentions that when a background agent's follow-up reply is discarded, Claude in auto mode is now explicitly informed, and repeated wake-ups while an agent waits for a background command are reduced.

Claude Code's agent system is divided into the main agent and sub-agents: sub-agents are spawned by the main agent to handle subtasks such as searching and editing in parallel, each with its own independent context window. The context limit refers to the total number of tokens that can be carried in a single request, while effort is a tier parameter controlling how much reasoning the model invests; both directly affect the cost and quality of sub-agents. If a sub-agent inherits the main agent's model and limit, it may compress context too early in long tasks or incur costs that do not match the task. The session recovery mechanism relies on persisted message records, where each message has an identifier such as a UUID, and state must be rebuilt by identifier after a crash or when moved to the background. When anomalies such as resends, empty replies, or killed processes occur, mismatched identifiers lead to message loss or context fragmentation.

Terminal Rendering and Platform Stability

A large number of terminal display issues were fixed in this update, including most scrollback history being garbled in Ghostty when resizing the window, link addresses being hidden in Windows Terminal under older tmux and VTE 0.50.0, no selection highlight in 16-color mode, and garbled lines in tmux with allow-passthrough enabled in kitty, Ghostty, or iTerm2.

On Linux, the issue where startup occasionally fell back to the shell during a restart was fixed, for example after first logging in to the Claude apps gateway or enabling Code Mode. Proxy-related issues were also addressed: when https_proxy or HTTPS_PROXY is a bare host:port and neither input nor output is a terminal, Claude Code no longer refuses to start; and when claude -p gets stuck fetching model settings, it continues after 10 seconds instead of hanging.

Ghostty, kitty, and iTerm2 are all modern terminal emulators that support advanced graphics and hyperlink protocols, while tmux is a terminal multiplexer running on top of them. allow-passthrough is a tmux option that allows escape sequences to pass through to the outer terminal so that content such as images and hyperlinks can display properly, but different implementations parse passthrough sequences inconsistently, which easily produces garbled lines. VTE is the rendering library shared by many Linux terminals such as GNOME Terminal, and its version differences also affect hyperlink visibility. 16-color mode is a downgraded tier of terminal color capability; selection highlighting depends on specific color mappings, and when they are missing, the selected area becomes invisible. These compatibility details are exactly why terminal rendering fixes appear so frequently.

Performance and Boundary Optimizations in Request Handling

Some changes add protections against extreme inputs. WebFetch now rejects URLs longer than 2,000 characters directly before the permission prompt; messages containing thousands of @ mentions only parse the first 100 mentions, avoiding long stalls before replying; and stalls caused by thousands of unclosed tags in compressed replies were also fixed. At the tool level, Grep no longer duplicates or skips results when paginating with head_limit and offset, and the Read tool now reports the true file size instead of a fixed 512KB when a file of 10 MB or more cannot be read at once.

In addition, after long interruptions such as a VPN disconnect, most remote MCP servers accessed over https by hostname will retry in the background for about a day instead of remaining disconnected. This is a practical improvement for workflows that depend on remote MCP.

Conclusion

v2.1.327 is not a major feature release, but it delivers a dense round of fixes in secret security, configuration observability, session recovery reliability, and terminal compatibility. For developers who use Claude Code heavily, the main benefit of upgrading is fewer unexpected interruptions and fewer hard-to-diagnose environment issues. If your team is using self-hosted runners or multi-agent workflows, the related fixes in this update are worth verifying first.

This article is based on the official Claude Code v2.1.327 changelog; actual behavior is subject to the released version.

#Claude Code#v2.1.327#MCP#secret security#session recovery#terminal rendering#multi-agent
Share:

Related articles