Claude Code Update: Fixes Memory Leaks and Limits Subagents

Anthropic's CLI tool, Claude Code, has received a series of intensive engineering-focused updates. The latest version 2.1.217 not only optimizes search and command-line features but also implements safety and resource constraints for subagent operations. Combined with recent iterations, the tool has achieved significant performance breakthroughs, effectively resolving pain points like long-session stuttering.

Key Details and Performance Optimization

In version 2.1.217, Claude Code introduced a ripgrep-based Grep tool for faster, more accurate search results, increased the installation package size by 222.6 kB, and removed the `TEST_ENABLE_SESSION_PERSISTENCE` environment variable. Performance-wise, according to @AlexKim, version 2.1.208 successfully fixed memory leaks, reducing long-text record sizes by 79 times and boosting tool invocation speed in MCP-intensive sessions by 7 times. Additionally, the new version includes automatic emoji shortcode completion.

Security and Subagent Limitations

To prevent resource exhaustion, version 2.1.217 imposes major restrictions on subagent behavior. According to @ClaudeCodeLog and @sidjustice_, the system now defaults to a maximum of 20 concurrent subagents (developers can override this via environment variables). Furthermore, subagents no longer spawn nested subagents by default; enabling this requires setting `CLAUDE_CODE_MAX_SUBAGENT_SPAWN_DEPTH`, a move aimed at enhancing overall system security.

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

Full story(4 episodes)→