環境変数

CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS

セッションが中断された際に、前回のトランスクリプトのメッセージが経過何ミリ秒以内であれば自動再開を行うかを制御する設定です。

使い方・用途

  • 設定値なしまたは 0 で制限なしとなります。
  • 負の値または数値以外を指定した場合、1時間の有効期限が適用されます。
英語原文(公式ドキュメントより)

Maximum age in milliseconds of the last transcript message for a session that ended mid-turn to continue automatically on resume. When the last message is older than this bound, Claude Code skips both the CLAUDE_CODE_RESUME_INTERRUPTED_TURN automatic resume and the injected CLAUDE_CODE_RESUME_PROMPT continuation message, and the session starts idle so you continue explicitly. Unset or 0 means no bound; a negative or non-numeric value applies a one-hour bound. Spawn scripts for long-running agents can set this so a restart against an old transcript doesn't re-run a stale prompt. Claude Code sets a one-hour bound itself when it restarts a crashed agent view session that inherited its conversation from an interactive session. Requires Claude Code v2.1.211 or later