Claude Code v2.1.89 — `defer` Hooks, Flicker-Free Rendering, `PermissionDenied` Hook, `/buddy` April Fools Easter Egg, 40+ Fixes

Claude Code 2.1.89 landed overnight with 40+ changes, and the architectural headliner is one that power users have been waiting for: "defer" as a new permission decision in PreToolUse hooks. Headless scripts can now pause at a tool call boundary and resume later via -p --resume, letting an external process — another agent, a CI gate, or a human reviewer — make the go/no-go call before execution continues. Paired with the companion PermissionDenied hook (which fires when auto mode's classifier blocks an operation and can return {retry: true} to trigger a reattempt), this creates a complete hook-driven approval and retry loop that previously required custom session management.

On the reliability front, this release closes out several high-impact bugs. The StructuredOutput schema cache bug — which was causing approximately a 50% failure rate for workflows using multiple schemas — is gone. A memory leak where large JSON inputs were retained as LRU cache keys in long-running sessions is fixed, along with an autocompact thrash loop where context-heavy sessions could enter an infinite compact-refill-compact cycle burning tokens and budget without progress. The misleading "Rate limit reached" message on entitlement errors — the source of the viral GitHub issue from earlier this week — is replaced with the actual error text and actionable hints. The LSP server now auto-restarts after a crash instead of requiring a full session restart. MCP connections in -p mode are now capped at 5 seconds instead of blocking on the slowest server, which is a meaningful win for any CI/CD pipeline where a flaky MCP server previously froze every run. And yes — there is an April 1st exclusive: /buddy hatches a small creature that watches you code.

Additional fixes span CRLF doubling on Windows, nested CLAUDE.md re-injection in long sessions, CJK and emoji entries silently dropped from history, PreToolUse/PostToolUse absolute path behavior, PowerShell 5.1 argument-splitting hardening, and more. Update via npm install -g @anthropic-ai/claude-code@latest.

Read the full changelog at Anthropic / Official Changelog →