環境変数

CLAUDE_CODE_DISABLE_WINDOWS_SHELL_LAUNCHER

1 を設定すると、Windows 上で PowerShell ツールコマンドを cmd.exe ランチャーを経由せず直接起動する。デフォルトでは、このランチャーによりバックグラウンドで実行中の PowerShell コマンドがセッションの次のプロセスに持ち越される(セッションをバックグラウンドに回した場合など)。本変数を設定した場合、バックグラウンド化された PowerShell コマンドはセッションのプロセスが終了すると停止する。Bash コマンドには影響しない。Claude Code v2.1.269 以降が必要。

使い方・用途

  • 未設定(デフォルト)は cmd.exe ランチャー経由で起動し、バックグラウンド実行中の PowerShell コマンドがセッションの次のプロセスに持ち越される
  • 1 を設定すると PowerShell ツールコマンドを直接起動するが、バックグラウンド化したコマンドはセッションのプロセス終了時に停止する
  • Bash コマンドには影響しない。v2.1.269 以降で使用可能
英語原文(公式ドキュメントより)

Set to 1 to start PowerShell tool commands on Windows directly instead of through the cmd.exe launcher. By default, the launcher lets a PowerShell command running in the background carry over to the session's next process, such as when you background the session. If you set the variable, a backgrounded PowerShell command stops when the session's process exits. Bash commands aren't affected. Requires Claude Code v2.1.269 or later