環境変数

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

関連する変更履歴

v2.1.269(1件)

Fixed
CLAUDE_CODE_RESUME_INTERRUPTED_TURN が、6時間以上前のAPIエラーで失敗したターンを再実行しないように修正した。
英語原文を表示
Fixed CLAUDE_CODE_RESUME_INTERRUPTED_TURN re-running a turn that had failed with an API error over 6 hours earlier, or longer ago than CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS when set

変更前

Fixed CLAUDE_CODE_RESUME_INTERRUPTED_TURN re-running a turn that had failed with an API error over 6 hours earlier, or longer ago than CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS when set

変更後

設定した CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS より前のターンを再実行しないことで、6時間以上前のAPIエラーが発生したターンの再実行を修正しました。

ユーザーへの恩恵

CLAUDE_CODE_RESUME_INTERRUPTED_TURN_MAX_AGE_MS を設定することで、6時間以上前のターンやAPIエラーが発生したターンを再実行しないように制御できる。