v2.1.50
Claude CodeSummary
This release introduces significant stability and memory management improvements, fixing numerous memory leaks across sessions, task handling, and diagnostics. Key new features include declarative agent worktree isolation, new CLI commands for agent management, and expanded context window control via environment variables.
New Features
- Added support for configuring the startup timeout for LSP servers via the `startupTimeout` setting.
- Introduced `WorktreeCreate` and `WorktreeRemove` hook events to allow custom setup/teardown when agent worktrees are managed.
- Enabled declarative use of isolated git worktrees for agents via `isolation: worktree` in agent definitions.
- Added the `claude agents` command to the CLI for listing all configured agents.
- Added support for the `CLAUDE_CODE_DISABLE_1M_CONTEXT` environment variable to disable the 1M context window feature.
- Enabled the full 1M context window support for Opus 4.6 (fast mode).
- Added support for the `/extra-usage` command within VS Code sessions.
Bug Fixes
- Fixed an issue where resumed sessions could be invisible when the working directory contained symlinks due to inconsistent path resolution during startup.
- Fixed session data loss upon SSH disconnect by ensuring session data is flushed before hooks and analytics during graceful shutdown.
- Fixed native modules failing to load on Linux systems using glibc older than 2.30 (e.g., RHEL 8).
- Fixed a memory leak in agent teams where completed teammate tasks were not being garbage collected from session state.
- Fixed `CLAUDE_CODE_SIMPLE` mode to correctly strip down skills, session memory, custom agents, and CLAUDE.md token counting.
- Fixed the `/mcp reconnect` command from freezing the CLI when provided with a non-existent server name.
- Fixed a memory leak where completed task state objects were not being removed from AppState.
- Fixed an issue where MCP tools were not discovered when tool search was enabled and a prompt was provided as a launch argument.
- Fixed unbounded memory growth in long sessions by capping file history snapshots.
- Fixed a memory leak where LSP diagnostic data was not cleaned up after delivery.
- Fixed a memory leak where completed task output was not being freed from memory.
- Fixed a prompt suggestion cache regression that resulted in lower cache hit rates.
- Fixed a memory leak where TaskOutput retained recent lines after cleanup.
- Fixed a memory leak in CircularBuffer where cleared items were retained in the backing array.
- Fixed a memory leak in shell command execution where ChildProcess and AbortController references were retained after cleanup.
Improvements
- The `CLAUDE_CODE_SIMPLE` mode now also disables MCP tools, attachments, hooks, and CLAUDE.md file loading for a fully minimal experience.
- Improved memory usage during long sessions by clearing internal caches after compaction.
- Improved memory usage during long sessions by clearing large tool results after they have been processed.
- Improved startup performance for headless mode (`-p` flag) by deferring Yoga WASM and UI component imports.