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.
Related Articles
Claude Code v2.1.47 Released: 40+ Bug Fixes, Windows Overhaul, Memory Improvements, and Faster Startup
Anthropic ships Claude Code v2.1.47 with over 40 bug fixes targeting Windows rendering bugs, long-session memory leaks, a ~500ms startup improvement, plan mode preservation after compaction, and a revamped background agent kill shortcut.
Claude Code v2.1.49 Released: Background Agent Kill Fix, Startup Speedups, and Yoga WASM Memory Leaks Squashed
Anthropic ships Claude Code v2.1.49 with roughly 20 changes, including a fix for Ctrl+C and ESC being silently ignored during background agent execution, multiple startup performance improvements via MCP batching and auth-failure caching, an end to Yoga WASM memory growth in long sessions, file editing in simple mode, and new SDK capability fields.
Claude Sonnet 4.6 Becomes the Default for Free and Pro Users — Outperforms Opus 4.5 on Coding Agent Benchmarks
Anthropic has made Claude Sonnet 4.6 the default model for claude.ai's Free and Pro plans. Released February 17, 2026, it matches Sonnet 4.5 pricing at $3/$15 per million tokens while internal Claude Code evaluations show it beating the previous frontier model, Opus 4.5, 59% of the time on agentic coding tasks.
Popular Articles
868 Agentic Skills, One Command: Antigravity Awesome Skills Becomes the Cross-Tool Skill Standard
Antigravity Awesome Skills (v5.4.0) delivers 868+ battle-tested skills for Claude Code, Gemini CLI, Codex CLI, Cursor, GitHub Copilot, and five other AI coding assistants via a single npx command. With official skills from Anthropic, Vercel, OpenAI, Supabase, and Microsoft consolidated under one MIT-licensed repository, it's emerging as the portable skill layer for the fragmented AI coding agent landscape.
How Claude Sonnet 4.6 Agent Teams Achieve 4x Productivity: Practical Insights from Anthropic's Own Research
Two Anthropic studies—a survey of 132 internal engineers and an analysis of 1M+ real-world agent interactions—reveal the precise delegation strategies and autonomy patterns that enable high-performing teams to multiply output with Claude Sonnet 4.6 agent teams.
What Actually Makes OpenClaw Special: The Full Story from VibeTunnel to 200k+ GitHub Stars
The three-stage VibeTunnel→Clawdbot→OpenClaw evolution, Pi runtime philosophy, why HEARTBEAT is the real differentiator from Claude Code, and the ClawHub supply chain attack (12% of skills were malicious). An unvarnished look at the most used and most misunderstood OSS agent.
Latest Articles
Two AI Agent Communication Projects Hit Hacker News Simultaneously, Targeting MCP's Blind Spots
Aqua and Agent Semantic Protocol appeared on Hacker News on the same day, both tackling the same unsolved problem: how AI agents communicate directly without a central broker, across network boundaries, and asynchronously.
Claude Sonnet 4.6 Becomes the Default for Free and Pro Users — Outperforms Opus 4.5 on Coding Agent Benchmarks
Anthropic has made Claude Sonnet 4.6 the default model for claude.ai's Free and Pro plans. Released February 17, 2026, it matches Sonnet 4.5 pricing at $3/$15 per million tokens while internal Claude Code evaluations show it beating the previous frontier model, Opus 4.5, 59% of the time on agentic coding tasks.
Google Permanently Bans AI Pro Users for Accessing Gemini via OpenClaw, Continues Charging $250/Month
A Hacker News post garnering 140 points and 107 comments details how Google terminated Google AI Pro and Ultra accounts without warning after users accessed Gemini through OpenClaw, a third-party client. The incident surfaces deeper issues around prompt caching, subscription economics, and how AI providers enforce terms of service.