環境変数

CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT

1を設定すると、重要なパスに対する削除プロンプトの時間制限が解除される。auto モードでは Claude Code が代わりにこれらの削除を分類器に送り、bypassPermissions モードではプロンプトがユーザーの回答を待つようになる。Claude Code は設定 env ブロックで渡されたコピーを無視するため、Claude Code を起動する環境で設定すること。Claude Code v2.1.281 以降が必要

使い方・用途

  • デフォルトでは危険な rm プロンプトは2分間の応答待ちの後コマンドを拒否して書き換えのヒントを表示するが、1 を設定するとこのタイムアウトが無効化される
  • auto モードでは削除の判断が分類器に委ねられ、bypassPermissions モードではユーザーの回答を無期限に待つため、監視者がいる対話的なセッションで使う
  • 起動環境の環境変数としてのみ読まれ、settings.json の env ブロックに書いても無視される点に注意
英語原文(公式ドキュメントより)

Set to 1 to turn off the time limit on critical-path removal prompts. In auto mode Claude Code then sends these removals to the classifier instead, and in bypassPermissions mode the prompt waits for your answer. Set it in the environment that launches Claude Code, since Claude Code ignores a copy delivered through a settings env block. Requires Claude Code v2.1.281 or later

関連ドキュメント

関連する変更履歴

v2.1.281(1件)

Changed
--dangerously-skip-permissions とオートモードにおける危険な rm のプロンプトを変更した。2分間回答を待ち、回答がなければ書き換えのヒント付きでコマンドを拒否し、無人セッションが継続できるようにする (CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT=1 で無効化できる)
英語原文を表示
Changed the dangerous rm prompt in --dangerously-skip-permissions and auto mode to wait 2 minutes for an answer, then deny the command with a rewrite hint so unattended sessions keep going (CLAUDE_CODE_DISABLE_DANGEROUS_RM_TIMEOUT=1 turns this off)

変更後

无人值守会话不再因为等待危险的 rm 命令确认而永久卡住。即使操作者不在位,会话也能在最多 2 分钟后自动继续运行。