v2.1.89
📝 概要
Claude Code v2.1.89は、defer権限、フリッカーフリー描画、多数のバグ修正と安定性向上を含む大型アップデート
🔄 主な変更点
新機能:
PreToolUseフックに"defer"権限決定を追加 - ヘッドレスセッションでツール呼び出し時に一時停止し、-p --resumeで再評価可能にCLAUDE_CODE_NO_FLICKER=1環境変数でフリッカーフリーな代替画面レンダリングに対応PermissionDeniedフック追加 - 自動モード分類器による拒否後に発火し、{retry: true}でモデルに再試行を指示可能@メンション候補に名前付きサブエージェントを追加/buddyコマンド追加(エイプリルフール企画 - コーディングを見守る小さな生き物)
改善:
- 自動モード: 拒否されたコマンドが通知表示され、
/permissionsの最近タブに表示されrで再試行可能に EditツールがBashでsed -nやcatで閲覧したファイルに対して別途Read不要で動作- MCP接続を非ブロッキング化する
MCP_CONNECTION_NONBLOCKING=trueと、--mcp-configサーバー接続を5秒でタイムアウト - 折りたたまれたツールサマリーが
ls/tree/duに対して「N個のディレクトリをリスト」と表示 @メンション候補が類似名のMCPリソースよりソースファイルを優先
バグ修正(主要):
Edit(//path/**)およびRead(//path/**)許可ルールがシンボリックリンクの解決先を確認するように修正- Windows上でEdit/Writeツールが改行コードを二重化する問題を修正
StructuredOutputスキーマキャッシュバグによる約50%の失敗率を修正- 大量JSONのメモリリーク修正(長時間セッションでLRUキャッシュキーとして保持)
- 50MB超の大規模セッションファイルからメッセージ削除時のクラッシュ修正
- LSPサーバークラッシュ後のゾンビ状態を修正 - 次のリクエストで自動再起動
- CJKや絵文字を含むプロンプト履歴が4KB境界で削除される問題を修正
/statsがサブエージェント使用量を除外してトークンを過小計上していた問題を修正-p --resumeが64KB超の入力でハングする問題を修正- 自動コンパクト無限ループ問題を修正 - 3回連続でコンパクト直後に上限到達時にエラーで停止
💡 解説・活用案
今回のdefer権限機能により、ヘッドレスモードでも危険なツール実行前に人間の承認を挟めるようになり、CI/CD環境での安全性が大幅に向上します。またCLAUDE_CODE_NO_FLICKER=1は特にSSH越しの作業で画面のちらつきが気になる場合に有効で、より快適な開発体験を提供します。多数のバグ修正により、特に長時間セッションやWindows環境、CJK文字を含むプロンプト履歴の扱いが大幅に安定化しました。
🌐 日本語訳
変更点
PreToolUseフックに"defer"権限決定を追加 — ヘッドレスセッションでツール呼び出し時に一時停止し、-p --resumeでフックを再評価可能CLAUDE_CODE_NO_FLICKER=1環境変数を追加 — 仮想スクロールバック付きフリッカーフリーの代替画面レンダリングを有効化PermissionDeniedフックを追加 — 自動モード分類器による拒否後に発火。{retry: true}を返すとモデルに再試行を指示@メンション候補に名前付きサブエージェントを追加-pモードでMCP_CONNECTION_NONBLOCKING=trueを追加 — MCP接続待機を完全にスキップ。--mcp-configサーバー接続を最も遅いサーバーでブロックする代わりに5秒で制限- 自動モード: 拒否されたコマンドが通知表示され、
/permissions→ 最近タブに表示されrで再試行可能 Edit(//path/**)およびRead(//path/**)許可ルールが、要求されたパスだけでなく解決されたシンボリックリンクターゲットを確認するように修正- 一部の修飾キー組み合わせで音声プッシュツートークが起動しない問題、およびWindows上で音声モードが「WebSocket upgrade rejected with HTTP 101」で失敗する問題を修正
- Windows上でEdit/WriteツールがCRLFを二重化し、Markdownのハード改行(末尾の2スペース)を削除する問題を修正
StructuredOutputスキーマキャッシュバグによる複数スキーマ使用時の約50%失敗率を修正- 長時間セッションでLRUキャッシュキーとして大量のJSON入力が保持されるメモリリークを修正
- 非常に大きい(50MB超)セッションファイルからメッセージ削除時のクラッシュを修正
- LSPサーバークラッシュ後のゾンビ状態を修正 — セッション再起動まで失敗し続ける代わりに、次のリクエストでサーバーが再起動
~/.claude/history.jsonlの4KB境界に該当するCJKや絵文字を含むプロンプト履歴エントリが無言で削除される問題を修正/statsがサブエージェント使用量を除外してトークンを過小計上し、統計キャッシュ形式変更時に30日を超える履歴データを失う問題を修正- 遅延ツール入力が64KBを超えるか遅延マーカーが存在しない場合の
-p --resumeハング、および-p --continueが遅延ツールを再開しない問題を修正 - macOS上で
claude-cli://ディープリンクが開かない問題を修正 - サーバーがマルチ要素エラーコンテンツを返す際、MCPツールエラーが最初のコンテンツブロックのみに切り詰められる問題を修正
- SDK経由で画像付きメッセージ送信時にスキルリマインダーやその他のシステムコンテキストが削除される問題を修正
- PreToolUse/PostToolUseフックがWrite/Edit/Readツールに対して
file_pathを絶対パスで受け取るように修正(文書化された動作に一致) - 自動コンパクト無限ループを修正 — 3回連続でコンパクト直後にコンテキストが上限まで再充填された場合を検出し、API呼び出しを浪費する代わりに実行可能なエラーで停止
- ツールスキーマバイトがセッション途中で変更されることによる長時間セッションでのプロンプトキャッシュミスを修正
- 多数のファイルを読み込む長時間セッションでネストされたCLAUDE.mdファイルが数十回再注入される問題を修正
- 旧バージョンのCLIまたは中断された書き込みからのツール結果を含むトランスクリプトで
--resumeがクラッシュする問題を修正 - APIがエンタイトルメントエラーを返した際の誤解を招く「Rate limit reached」メッセージを修正 — 実際のエラーと実行可能なヒントを表示
- フック
if条件フィルタリングが複合コマンド(ls && git push)や環境変数プレフィックス付きコマンド(FOO=bar git push)にマッチしない問題を修正 - 大量の並列ツール使用中に折りたたまれた検索/読み取りグループバッジがターミナルスクロールバックで重複する問題を修正
- 通知
invalidatesが現在表示中の通知を即座にクリアしない問題を修正 - 処理中にバックグラウンドメッセージが到着した際に送信後プロンプトが一瞬消える問題を修正
- アシスタント出力でデーヴァナーガリーやその他の結合記号テキストが切り詰められる問題を修正
- レイアウトシフト後のメイン画面ターミナルでのレンダリングアーティファクトを修正
- macOS Apple Silicon上で音声モードがマイク権限をリクエストできない問題を修正
- Windows Terminal Preview 1.25でShift+Enterが改行挿入ではなく送信する問題を修正
- tmux内でiTerm2実行時のストリーミング中の定期的なUIジッターを修正
- Windows PowerShell 5.1で
git pushなどのコマンドがstderrに進捗を書き込んだ際にPowerShellツールが誤って失敗を報告する問題を修正 - Editツールが非常に大きなファイル(>1 GiB)に使用された際の潜在的なメモリ不足クラッシュを修正
- 折りたたまれたツールサマリーが
ls/tree/duに対して「N個のファイルを読み込み」ではなく「N個のディレクトリをリスト」と表示するように改善 - Bashツールがフォーマッター/リンターコマンドが以前読み込んだファイルを変更した際に警告し、古い編集エラーを防ぐように改善
@メンション候補が類似名のMCPリソースよりソースファイルを優先するように改善- PowerShellツールプロンプトにバージョン適切な構文ガイダンス(5.1 vs 7+)を改善
Editが別途Read呼び出しなしでBashでsed -nやcatを使って閲覧したファイルに対して動作するように変更- 50K文字を超えるフック出力が、コンテキストに直接注入される代わりにファイルパス+プレビューでディスクに保存されるように変更
- settings.jsonの
cleanupPeriodDays: 0が検証エラーで拒否されるように変更 — 以前はトランスクリプト永続化を無言で無効化 - 対話セッションでthinkingサマリーがデフォルトで生成されなくなりました — 復元するにはsettings.jsonで
showThinkingSummaries: trueを設定 TaskCreatedフックイベントとそのブロッキング動作を文書化- Ctrl+Bで実行中のコマンドをバックグラウンド化した際のタスク通知を保持
- Windows上のPowerShellツール: ダブルクォートと空白の両方を含む外部コマンド引数が自動許可ではなくプロンプト表示(PS 5.1引数分割の堅牢化)
/envがPowerShellツールコマンドに適用されるようになりました(以前はBashのみ影響)/usageがProおよびEnterpriseプランで冗長な「Current week (Sonnet only)」バーを非表示- 画像ペーストで末尾スペースが挿入されなくなりました
- 空のプロンプトに
!commandを貼り付けるとbashモードに入るようになりました(入力した!の動作と一致) /buddyが4月1日用に追加 — コーディングを見守る小さな生き物を孵化させます
原文(英語)を表示
What's changed
- Added
"defer"permission decision toPreToolUsehooks — headless sessions can pause at a tool call and resume with-p --resumeto have the hook re-evaluate - Added
CLAUDE_CODE_NO_FLICKER=1environment variable to opt into flicker-free alt-screen rendering with virtualized scrollback - Added
PermissionDeniedhook that fires after auto mode classifier denials — return{retry: true}to tell the model it can retry - Added named subagents to
@mention typeahead suggestions - Added
MCP_CONNECTION_NONBLOCKING=truefor-pmode to skip the MCP connection wait entirely, and bounded--mcp-configserver connections at 5s instead of blocking on the slowest server - Auto mode: denied commands now show a notification and appear in
/permissions→ Recent tab where you can retry withr - Fixed
Edit(//path/**)andRead(//path/**)allow rules to check the resolved symlink target, not just the requested path - 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"
- Fixed Edit/Write tools doubling CRLF on Windows and stripping Markdown hard line breaks (two trailing spaces)
- Fixed
StructuredOutputschema cache bug causing ~50% failure rate when using multiple schemas - Fixed memory leak where large JSON inputs were retained as LRU cache keys in long-running sessions
- Fixed a crash when removing a message from very large session files (over 50MB)
- Fixed LSP server zombie state after crash — server now restarts on next request instead of failing until session restart
- 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 - Fixed
-p --resumehangs when the deferred tool input exceeds 64KB or no deferred marker exists, and-p --continuenot resuming deferred tools - Fixed
claude-cli://deep links not opening on macOS - Fixed MCP tool errors truncating to only the first content block when the server returns multi-element error content
- Fixed skill reminders and other system context being dropped when sending messages with images via the SDK
- Fixed PreToolUse/PostToolUse hooks to receive
file_pathas an absolute path for Write/Edit/Read tools, matching the documented behavior - 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
- Fixed prompt cache misses in long sessions caused by tool schema bytes changing mid-session
- Fixed nested CLAUDE.md files being re-injected dozens of times in long sessions that read many files
- Fixed
--resumecrash when transcript contains a tool result from an older CLI version or interrupted write - Fixed misleading "Rate limit reached" message when the API returned an entitlement error — now shows the actual error with actionable hints
- Fixed hooks
ifcondition filtering not matching compound commands (ls && git push) or commands with env-var prefixes (FOO=bar git push) - Fixed collapsed search/read group badges duplicating in terminal scrollback during heavy parallel tool use
- Fixed notification
invalidatesnot clearing the currently-displayed notification immediately - Fixed prompt briefly disappearing after submit when background messages arrived during processing
- Fixed Devanagari and other combining-mark text being truncated in assistant output
- Fixed rendering artifacts on main-screen terminals after layout shifts
- Fixed voice mode failing to request microphone permission on macOS Apple Silicon
- Fixed Shift+Enter submitting instead of inserting a newline on Windows Terminal Preview 1.25
- Fixed periodic UI jitter during streaming in iTerm2 when running inside tmux
- Fixed PowerShell tool incorrectly reporting failures when commands like
git pushwrote progress to stderr on Windows PowerShell 5.1 - Fixed a potential out-of-memory crash when the Edit tool was used on very large files (>1 GiB)
- Improved collapsed tool summary to show "Listed N directories" for
ls/tree/duinstead of "Read N files" - Improved Bash tool to warn when a formatter/linter command modifies files you have previously read, preventing stale-edit errors
- Improved
@-mention typeahead to rank source files above MCP resources with similar names - Improved PowerShell tool prompt with version-appropriate syntax guidance (5.1 vs 7+)
- Changed
Editto work on files viewed viaBashwithsed -norcat, without requiring a separateReadcall first - Changed hook output over 50K characters to be saved to disk with a file path + preview instead of being injected directly into context
- Changed
cleanupPeriodDays: 0in settings.json to be rejected with a validation error — it previously silently disabled transcript persistence - Changed thinking summaries to no longer be generated by default in interactive sessions — set
showThinkingSummaries: truein settings.json to restore - Documented
TaskCreatedhook event and its blocking behavior - Preserved task notifications when backgrounding a running command with Ctrl+B
- PowerShell tool on Windows: external-command arguments containing both a double-quote and whitespace now prompt instead of auto-allowing (PS 5.1 argument-splitting hardening)
/envnow applies to PowerShell tool commands (previously only affected Bash)/usagenow hides redundant "Current week (Sonnet only)" bar for Pro and Enterprise plans- Image paste no longer inserts a trailing space
- Pasting
!commandinto an empty prompt now enters bash mode, matching typed!behavior /buddyis here for April 1st — hatch a small creature that watches you code