環境変数

CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS

Claude Code が Remote Control や SDK ホストなどのリモートクライアントへ転送するダイアログ、および保留されたセッション横断メッセージの承認ダイアログをキャンセルするまでの期限(ミリ秒)。権限プロンプトと AskUserQuestion の質問はそれぞれ独自のフローを使うため、この制限の対象外。Claude Code v2.1.236 以降では、無人で実行している可能性のあるセッション内のセッション中 Fable 利用クレジット同意プロンプトにもこの期限が適用される。期限が適用されないケースを含む保留メッセージの完全な有効期限ルールは、Control inbound messages と non-interactive sessions を参照。dialogExpiry 設定を上書きする。0 または負の値で期限を無効にする。プロジェクト設定とローカル設定では無視される。

使い方・用途

  • Remote Control や SDK ホストに転送したダイアログに誰も応答しないまま放置され、待機が止まるのを避けたいとき、一定時間後に自動でキャンセルさせて処理を続けさせる。
  • 無人のセッション中に表示される Fable 利用クレジットの同意プロンプトが永遠に待ち続けるのを防ぎ、期限を過ぎたらデフォルト動作に進めたい。
  • セッション単位で dialogExpiry の期限を一時的に上書きしたいとき、設定ファイルを書き換えずにこの環境変数だけで制御する。
英語原文(公式ドキュメントより)

Deadline in milliseconds before Claude Code cancels a dialog it forwards to a remote client such as a Remote Control or SDK host, or the approval dialog for a held cross-session message; permission prompts and AskUserQuestion questions use their own flows and aren't governed by it. On Claude Code v2.1.236 or later, it also bounds the mid-session Fable usage-credits consent prompt in a session that may be running unattended. Control inbound messages and non-interactive sessions cover the full held-message expiry rules, including the cases where the deadline doesn't apply. Overrides the dialogExpiry setting. 0 or a negative value disables the deadline. Ignored in project and local settings

関連ドキュメント

関連する変更履歴

v2.1.290(1件)

Fixed
CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS=5m が 5 ミリ秒と読み取られてリモートダイアログが即座にキャンセルされる問題を修正した。単位接尾辞付きの値は dialogExpiry にフォールバックするようになった。
英語原文を表示
Fixed CLAUDE_CODE_USER_DIALOG_TIMEOUT_MS=5m being read as 5 ms and cancelling remote dialogs at once; values with a unit suffix now fall back to dialogExpiry

関連ドキュメント