Claude Code v2.1.50: Worktree Hooks, Agent Memory Overhaul, Opus 4.6 Gets 1M Context
Anthropic ships Claude Code v2.1.50 with WorktreeCreate/WorktreeRemove hook events, declarative worktree isolation in agent definitions, a fix for session data loss on SSH disconnect, a native module compatibility fix for older glibc Linux systems, an avalanche of memory leak fixes targeting long-running sessions, and Opus 4.6 fast mode now supporting the full 1M context window.
Anthropic published Claude Code v2.1.50 to npm on February 20, 2026 (UTC), approximately 24 hours after v2.1.49. The release ships roughly 26 changes, with memory management improvements dominating the changelog: at least nine separate memory leaks across long-running sessions, agent teams, LSP servers, and shell execution are addressed in a single release. The update also introduces new worktree lifecycle hooks, a declarative isolation option in agent definitions, a Linux compatibility fix for older enterprise distributions, and 1M context support for Opus 4.6 fast mode.
Worktree Lifecycle Hooks
Two new hook events — WorktreeCreate and WorktreeRemove — fire when agent worktree isolation creates or removes a git worktree. This gives teams a clean integration point for custom VCS setup and teardown scripts that need to stay aligned with agent isolation boundaries. CI systems, monorepo setups with custom branch conventions, or deployments that need to register worktrees with external tooling all stand to benefit.
Declarative Worktree Isolation in Agent Definitions
Agent definition files can now include isolation: worktree to declare that the agent should run inside an isolated git worktree. Previously, achieving isolation required external configuration or wrapper scripts. The declarative form keeps isolation policy colocated with the agent definition itself, making it easier to audit and reproduce.
SSH Disconnect No Longer Causes Session Data Loss
When an SSH connection drops, Claude Code’s graceful shutdown sequence now flushes session data before running hooks and analytics. Previously, hooks and analytics could race ahead and exit before session data was written, silently discarding session history. Users on remote development setups over SSH will find their session state preserved through unexpected disconnections.
Resumed Sessions Now Visible When Working Directory Contains Symlinks
A startup path resolution inconsistency caused sessions to become invisible in the resume picker when the working directory included symlinks. The session storage path was resolved at different points during initialization, producing mismatched keys. This is fixed in v2.1.50.
Linux: Native Module Fix for Old glibc Systems
Native modules failed to load on Linux systems with glibc versions older than 2.30 — a threshold that excludes RHEL 8 and comparable enterprise distributions. This is now fixed, broadening Claude Code’s compatibility with the kind of locked-down Linux environments common in regulated industries.
claude agents Command
A new claude agents CLI command lists all configured agents. Previously, there was no direct way to inspect registered agents from the terminal; users had to navigate config files manually. This is a small ergonomic addition but meaningful for teams managing more than a handful of agent definitions.
CLAUDE_CODE_SIMPLE Gets a Deeper Simplification
The CLAUDE_CODE_SIMPLE environment variable now strips far more than before. In addition to the previous reductions, v2.1.50 disables MCP tools, attachments, hooks, CLAUDE.md file loading, skills, session memory, custom agents, and CLAUDE.md token counting. The result is a fully minimal execution environment with drastically reduced token overhead — well-suited for CI pipelines or cost-controlled scripted use cases.
Startup Performance: Deferred Yoga WASM and UI Imports in Headless Mode
The -p (non-interactive) flag now defers Yoga WASM and UI component imports until they are actually needed. Since headless mode never renders a terminal UI, these imports previously ran unconditionally at startup and added avoidable latency. Cold start time for scripted and CI usage is reduced.
Opus 4.6 Fast Mode Now Supports 1M Context
Opus 4.6 in fast mode gains the full 1M token context window in v2.1.50. Sonnet 4.6 received 1M context support in v2.1.49; this extends the same capability to the Opus tier.
Additionally, a new CLAUDE_CODE_DISABLE_1M_CONTEXT environment variable allows operators to explicitly opt out of the 1M context window. This is useful for cost management or environments where context length needs to be bounded by policy rather than trust.
VS Code: /extra-usage Command
The /extra-usage command is now available inside VS Code sessions. It was previously terminal-only. VS Code extension users can now check additional token usage information without switching to a terminal.
Memory Management: Nine Fixes Across the Stack
v2.1.50 addresses a cluster of memory leaks that compounded during long sessions. Independently:
- Agent team task objects were never removed from
AppStateafter completion, causing unbounded growth in sessions running many tasks in parallel. - LSP diagnostic data accumulated without bound after delivery — each diagnostic was kept in memory indefinitely rather than being cleaned up post-delivery.
- Completed task output (
TaskOutput) was retained in memory after tasks finished. - TaskOutput “recent lines” buffer continued holding data after a cleanup pass.
- CircularBuffer was retaining cleared items in its backing array rather than releasing them.
- Shell command execution held
ChildProcessandAbortControllerreferences after commands completed. - Internal caches are now cleared after compaction runs, rather than accumulating across the session lifecycle.
- File history snapshots are now capped, preventing unbounded memory growth from snapshot accumulation over many edits.
- Large tool results are cleared from memory after processing rather than being retained for potential re-inspection.
The cumulative effect is significant: long-running sessions that previously required periodic restarts due to memory pressure should exhibit substantially more stable memory profiles.
Other Fixes
/mcp reconnectCLI freeze: Passing a non-existent server name no longer hangs the CLI.- MCP tool discovery with launch-argument prompts: MCP tools were not discovered when tool search was enabled and a prompt was provided as a launch argument. Fixed.
- Prompt suggestion cache: An additional regression fix continues work started in v2.1.49 to restore expected cache hit rates.
- LSP server
startupTimeout: Configuration support forstartupTimeouton LSP servers is now available.
Version Details
- Version: 2.1.50
- Published: February 20, 2026 (UTC) / February 21, 2026 (JST)
- npm: @anthropic-ai/claude-code
- Install / upgrade:
npm install -g @anthropic-ai/claude-code
Release Cadence Note
v2.1.50 continues Anthropic’s recent pattern of daily patch releases. The concentration of memory fixes suggests internal tooling or testing revealed a broad class of object lifecycle issues across agent, LSP, and shell subsystems simultaneously. For teams running production agentic workflows, upgrading is recommended.
関連記事
Claude Code v2.1.47 リリース - Windows対応強化・メモリ改善・40件超のバグ修正
Anthropicは2026年2月19日、Claude Code v2.1.47をリリースした。Windows環境の描画バグ修正、長時間セッションのメモリ改善、起動速度の向上(約500ms短縮)、コンテキスト圧縮後のプランモード保持など40件以上の修正が含まれる。
Claude Code v2.1.49 リリース - バックグラウンドエージェント制御改善・起動高速化・Sonnet 4.6の1Mコンテキスト対応
Anthropicは2026年2月20日、Claude Code v2.1.49をリリースした。バックグラウンドエージェント実行中のCtrl+C/ESC無視バグの修正、起動パフォーマンスの大幅改善、シンプルモードへのファイル編集ツール追加、Yoga WASMメモリリークの修正などが含まれる。また、MaxプランにおいてSonnet 4.6が1Mコンテキストに対応した。
Claude Code v2.1.50 リリース - Worktreeフック追加・大規模メモリリーク修正・Opus 4.6が1Mコンテキスト対応
Anthropicは2026年2月21日(JST)、Claude Code v2.1.50をリリースした。WorktreeCreate/WorktreeRemoveフックの追加、エージェント定義でのworktreeアイソレーション宣言対応、SSHセッション切断時のデータ損失修正、glibc 2.30以前のLinuxでのネイティブモジュール読み込み不具合修正、長時間セッションを対象とした複数のメモリリーク修正、Opus 4.6(高速モード)への1Mコンテキスト対応拡大などが含まれる。
人気記事
Claude Code v2.1.93 リリース - PreToolUseフック延期決定やフリッカーFREE渲染など
AnthropicがClaude Code v2.1.93をリリース。PreToolUseフックの延期決定機能、フリッカー-freeレンダリングオプション、PermissionDeniedフック、名前付きサブエージェントのタイプアヘッド対応などを含む。
Claude Code v2.1.92 リリース - forceRemoteSettingsRefreshやBedrockセットアップウィザードなど
AnthropicがClaude Code v2.1.92をリリース。forceRemoteSettingsRefreshポリシー設定、Bedrockセットアップウィザード、costコマンドの改善など多数の機能追加とバグ修正を含む。
Claude Code v2.1.84 リリース - PowerShellツールプレビューと環境設定の強化
Claude Code v2.1.84がリリース。Windows向けのPowerShellツール、環境変数によるモデル選択のカスタマイズアイドルセッション処理の改善などが含まれる。
最新記事
Claude Code v2.1.93 リリース - PreToolUseフック延期決定やフリッカーFREE渲染など
AnthropicがClaude Code v2.1.93をリリース。PreToolUseフックの延期決定機能、フリッカー-freeレンダリングオプション、PermissionDeniedフック、名前付きサブエージェントのタイプアヘッド対応などを含む。
Claude Code v2.1.92 リリース - forceRemoteSettingsRefreshやBedrockセットアップウィザードなど
AnthropicがClaude Code v2.1.92をリリース。forceRemoteSettingsRefreshポリシー設定、Bedrockセットアップウィザード、costコマンドの改善など多数の機能追加とバグ修正を含む。
Claude Code v2.1.91 リリース - MCPツール結果の永続化とEditツールの最適化
Claude Code v2.1.91ではMCPツールの結果サイズの上書き、シェル実行の制御強化、Editツールの効率改善などが行われた。