Change8

Claude Code hooks

Component

Updates related to the hooks component of Claude Code.

10 releases42 features115 bug fixesView all Claude Code releases

All HOOKS Features

  • Added `claude remote-control` subcommand for external builds, enabling local environment serving for all users.(v2.1.51)
  • Added support for custom npm registries and specific version pinning when installing plugins from npm sources(v2.1.51)
  • Added `CLAUDE_CODE_ACCOUNT_UUID`, `CLAUDE_CODE_USER_EMAIL`, and `CLAUDE_CODE_ORGANIZATION_UUID` environment variables for SDK callers to provide account info synchronously.(v2.1.51)
  • Added support for configuring the startup timeout for LSP servers via the `startupTimeout` setting.(v2.1.50)
  • Introduced `WorktreeCreate` and `WorktreeRemove` hook events to allow custom setup/teardown when agent worktrees are managed.(v2.1.50)
  • Enabled declarative use of isolated git worktrees for agents via `isolation: worktree` in agent definitions.(v2.1.50)
  • Added the `claude agents` command to the CLI for listing all configured agents.(v2.1.50)
  • Added support for the `CLAUDE_CODE_DISABLE_1M_CONTEXT` environment variable to disable the 1M context window feature.(v2.1.50)
  • Enabled the full 1M context window support for Opus 4.6 (fast mode).(v2.1.50)
  • Added support for the `/extra-usage` command within VS Code sessions.(v2.1.50)
  • Enabled direct file editing in Simple Mode (`CLAUDE_CODE_SIMPLE`) by including the file edit tool alongside the Bash tool.(v2.1.49)
  • Added `ConfigChange` hook event that fires when configuration files change during a session, supporting enterprise security auditing and optional blocking of settings changes.(v2.1.49)
  • Enabled SDK model info to include `supportsEffort`, `supportedEffortLevels`, and `supportsAdaptiveThinking` fields for capability discovery.(v2.1.49)
  • Added `last_assistant_message` field to Stop and SubagentStop hook inputs, allowing hooks to access the final assistant response text.(v2.1.47)
  • Added `chat:newline` keybinding action for configurable multi-line input.(v2.1.47)
  • Added `added_dirs` to the statusline JSON `workspace` section, exposing directories added via `/add-dir` to external scripts.(v2.1.47)
  • Enabled using `ctrl+f` to kill all background agents instead of double-pressing ESC, allowing background agents to continue running when ESC cancels the main thread.(v2.1.47)
  • Added CLI subcommands for authentication management: `claude auth login`, `claude auth status`, and `claude auth logout`(v2.1.41)
  • Added native binary support for Windows ARM64 (win32-arm64) architecture(v2.1.41)
  • Added support for restricting which sub-agents can be spawned using the `Task(agent_type)` syntax in agent "tools" frontmatter(v2.1.33)
  • Added `memory` frontmatter field support for agents, enabling persistent memory with `user`, `project`, or `local` scope(v2.1.33)
  • Added plugin name to skill descriptions and the `/skills` menu for better discoverability(v2.1.33)
  • VSCode: Added support for remote sessions, allowing OAuth users to browse and resume sessions from claude.ai(v2.1.33)
  • VSCode: Added git branch and message count to the session picker, with support for searching by branch name(v2.1.33)
  • Added environment variable `CLAUDE_CODE_ENABLE_TASKS` to temporarily disable the new task system.(v2.1.19)
  • Introduced shorthand accessors like `$0`, `$1`, etc., for accessing individual arguments within custom commands.(v2.1.19)
  • [SDK] Enabled replay of `queued_command` attachment messages as `SDKUserMessageReplay` events when `replayUserMessages` is active.(v2.1.19)
  • [VSCode] Enabled session forking and rewind functionality for all users.(v2.1.19)
  • Added `auto:N` syntax for configuring the MCP tool search auto-enable threshold based on context window percentage (0-100).(v2.1.9)
  • Added `plansDirectory` setting to customize the storage location for plan files.(v2.1.9)
  • Enabled external editor support (Ctrl+G) within the AskUserQuestion "Other" input field.(v2.1.9)
  • Added session URL attribution to commits and PRs generated from web sessions.(v2.1.9)
  • Added support for `PreToolUse` hooks to return `additionalContext` to the model.(v2.1.9)
  • Added `${CLAUDE_SESSION_ID}` string substitution for skills to access the current session ID.(v2.1.9)
  • Added a release channel toggle ('stable' or 'latest') accessible via the `/config` command.(v2.1.3)
  • [VSCode] Added a clickable destination selector for permission requests, allowing users to choose where settings are saved (this project, all projects, shared with team, or session only).(v2.1.3)
  • Added source path metadata to images dragged onto the terminal to help Claude understand image origins(v2.1.2)
  • Added clickable hyperlinks for file paths in tool output in terminals that support OSC 8 (like iTerm)(v2.1.2)
  • Added support for Windows Package Manager (winget) installations with automatic detection and update instructions(v2.1.2)
  • Added Shift+Tab keyboard shortcut in plan mode to quickly select "auto-accept edits" option(v2.1.2)
  • Added FORCE_AUTOUPDATE_PLUGINS environment variable to allow plugin autoupdate even when the main auto-updater is disabled(v2.1.2)
  • Added agent_type to SessionStart hook input, populated if --agent is specified(v2.1.2)

All HOOKS Bug Fixes

  • Fixed a security issue where `statusLine` and `fileSuggestion` hook commands could execute without workspace trust acceptance in interactive mode.(v2.1.51)
  • Fixed a security issue where HTTP hooks could interpolate arbitrary environment variables from header values; env var interpolation now requires an explicit `allowedEnvVars` list.(v2.1.51)
  • Fixed a bug where duplicate `control_response` messages (e.g. from WebSocket reconnects) could cause API 400 errors by pushing duplicate assistant messages into the conversation.(v2.1.51)
  • Fixed slash command autocomplete crashing when a plugin's SKILL.md description is a YAML array or other non-string type(v2.1.51)
  • Fixed an issue where resumed sessions could be invisible when the working directory contained symlinks due to inconsistent path resolution during startup.(v2.1.50)
  • Fixed session data loss upon SSH disconnect by ensuring session data is flushed before hooks and analytics during graceful shutdown.(v2.1.50)
  • Fixed native modules failing to load on Linux systems using glibc older than 2.30 (e.g., RHEL 8).(v2.1.50)
  • Fixed a memory leak in agent teams where completed teammate tasks were not being garbage collected from session state.(v2.1.50)
  • Fixed `CLAUDE_CODE_SIMPLE` mode to correctly strip down skills, session memory, custom agents, and CLAUDE.md token counting.(v2.1.50)
  • Fixed the `/mcp reconnect` command from freezing the CLI when provided with a non-existent server name.(v2.1.50)
  • Fixed a memory leak where completed task state objects were not being removed from AppState.(v2.1.50)
  • Fixed an issue where MCP tools were not discovered when tool search was enabled and a prompt was provided as a launch argument.(v2.1.50)
  • Fixed unbounded memory growth in long sessions by capping file history snapshots.(v2.1.50)
  • Fixed a memory leak where LSP diagnostic data was not cleaned up after delivery.(v2.1.50)
  • Fixed a memory leak where completed task output was not being freed from memory.(v2.1.50)
  • Fixed a prompt suggestion cache regression that resulted in lower cache hit rates.(v2.1.50)
  • Fixed a memory leak where TaskOutput retained recent lines after cleanup.(v2.1.50)
  • Fixed a memory leak in CircularBuffer where cleared items were retained in the backing array.(v2.1.50)
  • Fixed a memory leak in shell command execution where ChildProcess and AbortController references were retained after cleanup.(v2.1.50)
  • Fixed Ctrl+C and ESC being silently ignored when background agents are running; pressing twice within 3 seconds now kills all background agents.(v2.1.49)
  • Fixed prompt suggestion cache regression that was reducing cache hit rates.(v2.1.49)
  • Fixed `plugin enable` and `plugin disable` to auto-detect the correct scope when `--scope` is omitted, instead of defaulting to user scope.(v2.1.49)
  • Fixed verbose mode not updating the thinking block display when toggled via `/config` by ensuring memo comparators correctly detect verbose changes.(v2.1.49)
  • Fixed unbounded WASM memory growth during long sessions by periodically resetting the tree-sitter parser.(v2.1.49)
  • Fixed potential rendering issues caused by stale yoga layout references.(v2.1.49)
  • Fixed unbounded memory growth during long-running sessions caused by Yoga WASM linear memory never shrinking.(v2.1.49)
  • Fixed `disableAllHooks` setting to respect managed settings hierarchy, preventing non-managed settings from disabling policy-set managed hooks.(v2.1.49)
  • Fixed the `--resume` session picker showing raw XML tags for sessions starting with commands like `/clear`; it now correctly falls through to the session ID fallback.(v2.1.49)
  • Fixed FileWriteTool line counting to preserve intentional trailing blank lines instead of stripping them.(v2.1.47)
  • Fixed Windows terminal rendering bugs where line counts showed incorrect values (always 1) due to `os.EOL` (`\r\n`) in display code.(v2.1.47)
  • Fixed bold and colored text in markdown output shifting to the wrong characters on Windows due to `\r\n` line endings.(v2.1.47)
  • Fixed compaction failing when conversations contain many PDF documents by stripping document blocks alongside images before sending to the compaction API.(v2.1.47)
  • Fixed bash tool output being silently discarded on Windows when using MSYS2 or Cygwin shells.(v2.1.47)
  • Fixed the bash permission classifier from incorrectly granting permissions based on hallucinated descriptions.(v2.1.47)
  • Fixed user-defined agents only loading one file on NFS/FUSE filesystems that report zero inodes.(v2.1.47)
  • Fixed plugin agent skills silently failing to load when referenced by bare name instead of fully-qualified plugin name.(v2.1.47)
  • Fixed CWD tracking temp files never being cleaned up on Windows, preventing indefinite accumulation.(v2.1.47)
  • Fixed API 400 errors ("thinking blocks cannot be modified") in sessions with concurrent agents caused by interleaved streaming content blocks.(v2.1.47)
  • Fixed a single file write/edit error from aborting all other parallel file write/edit operations; independent mutations now complete on failure.(v2.1.47)
  • Fixed custom session titles set via `/rename` being lost after resuming a conversation.(v2.1.47)
  • Fixed collapsed read/search hint text overflowing on narrow terminals by truncating from the start.(v2.1.47)
  • Fixed bash commands using backslash-newline continuation lines (`\` followed by newline) producing spurious empty arguments.(v2.1.47)
  • Fixed built-in slash commands being hidden from the autocomplete dropdown when many user skills are installed.(v2.1.47)
  • Fixed MCP servers not appearing in the MCP Management Dialog after deferred loading.(v2.1.47)
  • Fixed session name persisting in status bar after `/clear` command.(v2.1.47)
  • Fixed crash when a skill's `name` or `description` in SKILL.md frontmatter is a bare number, by coercing the value to a string.(v2.1.47)
  • Fixed `/resume` silently dropping sessions when the first message exceeds 16KB or uses array-format content.(v2.1.47)
  • Fixed `claude doctor` misclassifying mise and asdf-managed installations as native installs.(v2.1.47)
  • Fixed zsh heredoc failing with "read-only file system" error in sandboxed commands.(v2.1.47)
  • Fixed agent progress indicator showing inflated tool use count.(v2.1.47)
  • Fixed image pasting not working on WSL2 systems where Windows copies images as BMP format.(v2.1.47)
  • Fixed background agent results returning raw transcript data instead of the agent's final answer.(v2.1.47)
  • Fixed Warp terminal incorrectly prompting for Shift+Enter setup when it supports it natively.(v2.1.47)
  • Fixed CJK wide characters causing misaligned timestamps and layout elements in the TUI.(v2.1.47)
  • Fixed custom agent `model` field in `.claude/agents/*.md` being ignored when spawning team teammates.(v2.1.47)
  • Fixed plan mode being lost after context compaction, causing the model to switch from planning to implementation mode.(v2.1.47)
  • Fixed `alwaysThinkingEnabled: true` in settings.json not enabling thinking mode on Bedrock and Vertex providers.(v2.1.47)
  • Fixed `tool_decision` OTel telemetry event not being emitted in headless/SDK mode.(v2.1.47)
  • Fixed session name being lost after context compaction; renamed sessions now preserve their custom title through compaction.(v2.1.47)
  • Fixed `/resume <session-id>` failing to find sessions whose first message exceeds 16KB.(v2.1.47)
  • Fixed "Always allow" on multiline bash commands creating invalid permission patterns that corrupt settings.(v2.1.47)
  • Fixed React crash (error #31) when a skill's `argument-hint` in SKILL.md frontmatter uses YAML sequence syntax, by coercing the value to a string.(v2.1.47)
  • Fixed crash when using `/fork` on sessions that used web search by gracefully handling null entries in search results.(v2.1.47)
  • Fixed read-only git commands triggering FSEvents file watcher loops on macOS by adding --no-optional-locks flag.(v2.1.47)
  • Fixed custom agents and skills not being discovered when running from a git worktree; project-level agent/skill directories are now included.(v2.1.47)
  • Fixed non-interactive subcommands like `claude doctor` and `claude plugin validate` being blocked inside nested Claude sessions.(v2.1.47)
  • Windows: Fixed the same CLAUDE.md file being loaded twice when drive letter casing differs between paths.(v2.1.47)
  • Fixed inline code spans in markdown being incorrectly parsed as bash commands.(v2.1.47)
  • Fixed teammate spinners not respecting custom spinnerVerbs from settings.(v2.1.47)
  • Fixed shell commands permanently failing after a command deletes its own working directory.(v2.1.47)
  • Fixed hooks (PreToolUse, PostToolUse) silently failing.(v2.1.47)
  • Fixed AWS authentication refresh hanging indefinitely by implementing a 3-minute timeout(v2.1.41)
  • Fixed file resolution failing for @-mentions that include anchor fragments (e.g., `@README.md#installation`)(v2.1.41)
  • Fixed FileReadTool blocking the main process when reading from FIFOs, `/dev/stdin`, or very large files(v2.1.41)
  • Fixed background task notifications failing to deliver when operating in streaming Agent SDK mode(v2.1.41)
  • Fixed cursor jumping to the end of the input field on every keystroke within classifier rule input(v2.1.41)
  • Fixed markdown link display text being incorrectly dropped, showing only the raw URL(v2.1.41)
  • Fixed users being incorrectly shown auto-compact failure error notifications(v2.1.41)
  • Fixed permission wait time being incorrectly included in the elapsed time displayed for subagents(v2.1.41)
  • Fixed proactive ticks firing erroneously while the tool is in plan mode(v2.1.41)
  • Fixed stale permission rules not being cleared when settings are modified on disk(v2.1.41)
  • Fixed hook blocking errors incorrectly displaying stderr content within the user interface(v2.1.41)
  • Fixed agent teammate sessions in tmux to send and receive messages correctly(v2.1.33)
  • Fixed warnings about agent teams not being available on your current plan(v2.1.33)
  • Fixed an issue where submitting a new message while the model was in extended thinking would interrupt the thinking phase(v2.1.33)
  • Fixed an API error that could occur when aborting mid-stream, where whitespace text combined with a thinking block would bypass normalization and produce an invalid request(v2.1.33)
  • Fixed API proxy compatibility issue where 404 errors on streaming endpoints no longer triggered non-streaming fallback(v2.1.33)
  • Fixed an issue where proxy settings configured via `settings.json` environment variables were not applied to WebFetch and other HTTP requests on the Node.js build(v2.1.33)
  • Fixed `/resume` session picker showing raw XML markup instead of clean titles for sessions started with slash commands(v2.1.33)
  • VSCode: Fixed scroll-to-bottom under-scrolling on initial session load and session switch(v2.1.33)
  • Fixed crashes occurring on processors that lack AVX instruction support.(v2.1.19)
  • Fixed dangling Claude Code processes when the terminal is closed by implementing SIGKILL as a fallback upon catching EIO errors from `process.exit()`. (v2.1.19)
  • Fixed `/rename` and `/tag` commands failing to update the correct session when resuming from a different directory (e.g., git worktrees).(v2.1.19)
  • Fixed session resuming by custom title failing when executed from a different directory.(v2.1.19)
  • Fixed pasted text content being lost when using prompt stash (Ctrl+S) and subsequent restore.(v2.1.19)
  • Fixed the agent list incorrectly displaying "Sonnet (default)" instead of "Inherit (default)" for agents without an explicit model setting.(v2.1.19)
  • Fixed backgrounded hook commands not returning early, which previously caused the session to wait unnecessarily.(v2.1.19)
  • Fixed file write preview incorrectly omitting empty lines.(v2.1.19)
  • Fixed API errors related to orphan tool_result blocks occurring during long sessions with parallel tool calls.(v2.1.9)
  • Fixed MCP server reconnection hanging when the cached connection promise fails to resolve.(v2.1.9)
  • Fixed Ctrl+Z suspend functionality not working in terminals utilizing the Kitty keyboard protocol (including Ghostty, iTerm2, kitty, and WezTerm).(v2.1.9)
  • Fixed plan files persisting across `/clear` commands, ensuring a fresh plan file is used after clearing a conversation.(v2.1.3)
  • Fixed false skill duplicate detection on filesystems with large inodes (e.g., ExFAT) by implementing 64-bit precision for inode values.(v2.1.3)
  • Fixed mismatch between the background task count displayed in the status bar and the items shown in the tasks dialog.(v2.1.3)
  • Fixed sub-agents using the incorrect model during conversation compaction.(v2.1.3)
  • Fixed web search in sub-agents using the incorrect model.(v2.1.3)
  • Fixed trust dialog acceptance when running from the home directory, ensuring trust-requiring features like hooks are enabled for the session.(v2.1.3)
  • Fixed a command injection vulnerability in bash command processing where malformed input could execute arbitrary commands(v2.1.2)
  • Fixed a memory leak where tree-sitter parse trees were not being freed, causing WASM memory to grow unbounded over long sessions(v2.1.2)
  • Fixed binary files (images, PDFs, etc.) being accidentally included in memory when using @include directives in CLAUDE.md files(v2.1.2)
  • Fixed updates incorrectly claiming another installation is in progress(v2.1.2)
  • Fixed crash when socket files exist in watched directories(v2.1.2)
  • Fixed remote session URL and teleport being broken when using /tasks command(v2.1.2)
  • Fixed MCP tool names being exposed in analytics events by sanitizing user-specific server configurations(v2.1.2)
  • Fixed usage display not updating after manual compact in VSCode(v2.1.2)

Releases with HOOKS Changes

v2.1.513 features4 fixes
Feb 24, 2026

This release introduces new capabilities for external builds with the `claude remote-control` subcommand and enhances plugin management by adding support for custom npm registries and version pinning. Several critical security issues related to hook execution and environment variable interpolation have been resolved, alongside performance improvements for BashTool and better context management for long conversations.

v2.1.507 features15 fixes
Feb 20, 2026

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.

v2.1.493 features9 fixes
Feb 19, 2026

This release introduces the ability to edit files directly within Simple Mode and adds a new configuration change hook for enhanced security auditing. Several critical bugs related to keyboard input handling, cache regressions, and unbounded memory growth during long sessions have been resolved. Performance has also been improved across startup and non-interactive modes through better caching and reduced API calls.

v2.1.474 features43 fixes
Feb 18, 2026

This release focuses heavily on stability and platform compatibility, delivering numerous bug fixes across Windows, shell execution, and file system interactions. Key improvements include better memory management for long sessions, faster file suggestion performance, and enhanced usability for the VS Code plan preview feature.

v2.1.412 features11 fixes
Feb 13, 2026

This release introduces new command-line tools for managing authentication (`claude auth`) and adds native support for Windows ARM64. Several critical bugs were resolved, including fixes for hanging AWS authentication, file resolution issues with @-mentions, and process blocking when reading large files or standard input.

v2.1.335 features8 fixes
Feb 6, 2026

This release introduces significant enhancements for multi-agent workflows, including persistent memory support via new frontmatter fields and better control over sub-agent spawning. Key bug fixes address issues with tmux sessions, API streaming errors, and proxy configuration reliability. VSCode users benefit from new session management features, including remote session browsing and improved session picker visibility.

v2.1.194 features8 fixes
Jan 23, 2026

This release introduces new shorthand argument accessors (`$0`, `$1`) for custom commands and enables session forking/rewind in VSCode for all users. Several critical bugs were resolved, including crashes on older processors and issues with session resumption across different directories.

v2.1.96 features3 fixes
Jan 16, 2026

This release introduces several new configuration and integration capabilities, including customizable plan storage and enhanced session context access via new string substitutions. Several critical bugs were resolved, specifically addressing failures in long parallel tool call sessions and improving terminal suspend functionality across various terminal emulators.

v2.1.32 features6 fixes
Jan 9, 2026

This release simplifies the user experience by merging slash commands and skills and introduces a new configuration option to select the release channel ('stable' or 'latest'). Several critical bugs were fixed, including issues with plan file persistence after clearing conversations and incorrect model usage in sub-agents. Additionally, VS Code users gain more control over permission saving destinations.

v2.1.26 features8 fixes
Jan 9, 2026

This release introduces several new capabilities, including source path metadata for dragged images and support for winget installations. Key fixes address a command injection vulnerability and memory leaks during long sessions. Additionally, large tool outputs are now saved to disk instead of being truncated, ensuring Claude has access to the full content.

Documentation

Read the hooks documentation