Claude Code Updates: Fixes Memory Leaks and Limits Subagents

Anthropic's CLI tool Claude Code received a series of dense engineering updates, focusing on resolving long-session performance bottlenecks and imposing security and resource limits on subagent mechanisms. These updates significantly improve the tool's stability and system security.

Confirmed

Performance Optimization and Experience Improvements

According to @AlexKim, version 2.1.208 successfully fixed memory leaks, reducing the size of long text logs by 79 times and increasing the speed of tool calls in MCP-intensive sessions by 7 times, effectively alleviating pain points like long-session lag. In version 2.1.217, as described by @ClaudeCodeLog, the system introduced a ripgrep-based Grep tool for faster and more accurate search results, increased the installation package size by 222.6 kB, and removed the TESTENABLESESSIONPERSISTENCE environment variable. Additionally, the new version added Slack-like emoji shortcode autocomplete.

Security and Subagent Limits

To prevent resource runaway, version 2.1.217 introduced important restrictions on subagent behavior. According to @ClaudeCodeLog and @sidjustice, the system now limits the number of concurrently running subagents to 20 by default (developers can override this via an environment variable). Meanwhile, by default, subagents can no longer spawn nested subagents; enabling this requires setting CLAUDECODEMAXSUBAGENTSPAWNDEPTH, an action aimed at enhancing overall system security.

2026-07-22 ~ 2026-07-22 · 7 related posts

Primary sources