Claude Code v2.1.89 adds deferrable hooks, permission retry, and fixes memory leaks

✍️ OpenClawRadar📅 Published: April 1, 2026🔗 Source
Claude Code v2.1.89 adds deferrable hooks, permission retry, and fixes memory leaks
Ad

Release v2.1.89: Hook improvements and critical fixes

Claude Code v2.1.89 adds several hook enhancements and addresses stability issues affecting long-running sessions. The release focuses on permission management, terminal rendering, and fixing crashes that could occur with large files or complex workflows.

New features and improvements

  • Deferrable PreToolUse hooks: Added "defer" permission decision to PreToolUse hooks. Headless sessions can pause at a tool call and resume with -p --resume to have the hook re-evaluate.
  • PermissionDenied hook: Added hook that fires after auto mode classifier denials. Return {retry: true} to tell the model it can retry.
  • Auto mode improvements: Denied commands now show a notification and appear in /permissions → Recent tab where you can retry with r.
  • Environment variables: Added CLAUDE_CODE_NO_FLICKER=1 environment variable to opt into flicker-free alt-screen rendering with virtualized scrollback. Added MCP_CONNECTION_NONBLOCKING=true for -p mode to skip the MCP connection wait entirely.
  • Subagent mentions: Added named subagents to @ mention typeahead suggestions.
  • MCP connection timeout: Bounded --mcp-config server connections at 5s instead of blocking on the slowest server.
  • Tool summary improvements: Improved collapsed tool summary to show "Listed N directories" for ls / tree / du instead of "Read N files".

Critical fixes

  • Memory leak: Fixed memory leak where large JSON inputs were retained as LRU cache keys in long-running sessions.
  • StructuredOutput failures: Fixed StructuredOutput schema cache bug causing ~50% failure rate when using multiple schemas.
  • Large file crashes: Fixed a potential out-of-memory crash when the Edit tool was used on very large files (>1 GiB).
  • Session file crashes: Fixed a crash when removing a message from very large session files (over 50MB).
  • LSP server recovery: Fixed LSP server zombie state after crash — server now restarts on next request instead of failing until session restart.
  • Autocompact thrashing: Fixed autocompact thrash loop — now detects when context refills to the limit immediately after compacting three times in a row and stops with an actionable error instead of burning API calls.

Platform-specific fixes

  • Windows: Fixed Edit/Write tools doubling CRLF on Windows and stripping Markdown hard line breaks (two trailing spaces). Fixed PowerShell tool incorrectly reporting failures when commands like git push wrote progress to stderr on Windows PowerShell 5.1. Fixed Shift+Enter submitting instead of inserting a newline on Windows Terminal Preview 1.25.
  • macOS: Fixed claude-cli:// deep links not opening on macOS. Fixed voice mode failing to request microphone permission on macOS Apple Silicon.
  • Cross-platform: Fixed voice push-to-talk not activating for some modifier-combo bindings, and voice mode on Windows failing with "WebSocket upgrade rejected with HTTP 101".
Ad

Additional fixes

  • Permission rules: Fixed Edit(//path/**) and Read(//path/**) allow rules to check the resolved symlink target, not just the requested path.
  • Hook conditions: Fixed hooks if condition filtering not matching compound commands (ls && git push) or commands with env-var prefixes (FOO=bar git push).
  • Path handling: Fixed PreToolUse/PostToolUse hooks to receive file_path as an absolute path for Write/Edit/Read tools, matching the documented behavior.
  • Resume functionality: Fixed -p --resume hangs when the deferred tool input exceeds 64KB or no deferred marker exists, and -p --continue not resuming deferred tools. Fixed --resume crash when transcript contains a tool result from an older CLI version or interrupted write.
  • Error messages: Fixed misleading "Rate limit reached" message when the API returned an entitlement error — now shows the actual error with actionable hints.
  • Data persistence: Fixed prompt history entries containing CJK or emoji being silently dropped when they fall on a 4KB boundary in ~/.claude/history.jsonl. Fixed /stats undercounting tokens by excluding subagent usage, and losing historical data beyond 30 days when the stats cache format changes.
  • MCP errors: Fixed MCP tool errors truncating to only the first content block when the server returns multi-element error content.
  • Context management: Fixed skill reminders and other system context being dropped when sending messages with images via the SDK. Fixed nested CLAUDE.md files being re-injected dozens of times in long sessions that read many files.
  • Rendering issues: Fixed Devanagari and other combining-mark text being truncated in assistant output. Fixed rendering artifacts on main-screen terminals after layout shifts. Fixed periodic UI jitter during streaming in iTerm2 when running inside tmux.
  • Cache issues: Fixed prompt cache misses in long sessions caused by tool schema bytes changing mid-session.
  • UI notifications: Fixed notification invalidates not clearing the currently-displayed notification immediately. Fixed prompt briefly disappearing after submit when background messages arrived during processing.
  • Terminal badges: Fixed collapsed search/read group badges duplicating in terminal scrollback during heavy parallel tool use.

This release primarily benefits developers using Claude Code for extended coding sessions, particularly those working with large files, complex permission systems, or headless automation workflows.

📖 Read the full source: GitHub Claude-Code

Ad

👀 See Also