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

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 --resumeto 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 → Recenttab where you can retry withr. - Environment variables: Added
CLAUDE_CODE_NO_FLICKER=1environment variable to opt into flicker-free alt-screen rendering with virtualized scrollback. AddedMCP_CONNECTION_NONBLOCKING=truefor-pmode to skip the MCP connection wait entirely. - Subagent mentions: Added named subagents to
@mention typeahead suggestions. - MCP connection timeout: Bounded
--mcp-configserver 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 / duinstead 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 pushwrote 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".
Additional fixes
- Permission rules: Fixed
Edit(//path/**)andRead(//path/**)allow rules to check the resolved symlink target, not just the requested path. - Hook conditions: Fixed hooks
ifcondition 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_pathas an absolute path for Write/Edit/Read tools, matching the documented behavior. - Resume functionality: Fixed
-p --resumehangs when the deferred tool input exceeds 64KB or no deferred marker exists, and-p --continuenot resuming deferred tools. Fixed--resumecrash 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/statsundercounting 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.mdfiles 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
invalidatesnot 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
👀 See Also

Running OpenClawd for Free: Successes and Challenges
In a recent post on r/clawdbot, a member shares their experience running OpenClawd without API keys, discussing their successes and the challenges faced.

GitHub Copilot Removes Opus Models from Pro Plan, Pauses New Signups
GitHub is removing Opus models from the Copilot Pro plan and pausing new signups for Pro, Pro+, and Student plans. Opus 4.7 remains available on Pro+, while Pro+ plans now offer more than 5X the usage limits of Pro.
Claude Code v2.1.140 Fixes Agent Tool Matching, /goal Hangs, Windows Event-Loop Stall
v2.1.140 improves Agent tool subagent_type matching to be case- and separator-insensitive, fixes /goal hanging with disableAllHooks, resolves Windows event-loop stall from missing executables, and more.

AI Tools May Lead to Homogenized Output in Creative and Development Work
A Reddit user reports that multiple teams using AI tools like ChatGPT, Co-Pilot, and Claude for strategy roadmaps and software development are producing similar outputs with identical buzzword patterns and design structures.