環境変数

CLAUDE_CODE_PROCESS_WRAPPER

Claude Code が起動するプロセスを、指定したラッパー実行ファイルを介して実行するように設定します。

使い方・用途

  • 企業のランチャー経由で実行する必要がある環境で使用し、設定値には実行ファイルの絶対パスを指定します
  • エージェントビューをホストするバックグラウンドサービスや、更新後の再起動プロセスなど、すべてのプロセスに適用されます
  • Windows は対象外であり、シェルエクスポートではなくユーザー設定または管理設定の env ブロックに記述する必要があります
英語原文(公式ドキュメントより)

Launch the processes Claude Code starts from its own binary through a wrapper executable, given as an argv prefix such as /opt/corp/launcher. Covers the background service that hosts agent view sessions, every session it spawns, and the relaunch Claude Code performs of itself to finish installing an update. The first token must be the absolute path of an executable that ends by running exec "$@", and most launchers are that single path. The value is an argument list, not a shell command: whitespace separates tokens, double quotes group a path that contains spaces, and a value that starts with is read as a JSON string array. Set it in the env block of user or [managed settings, not as a shell export, so the detached background service inherits it; project and local settings can't set it. The VS Code extension configures its own launcher separately through its claudeProcessWrapper setting. Ignored on Windows. CLAUDE_CODE_SHELL_PREFIX is a separate control: it wraps the shell commands Claude runs as a single quoted string, while this variable wraps Claude Code's own processes as an argv prefix. See Run Claude Code behind a corporate launcher

関連する変更履歴

v2.1.208(1件)

Added
環境変数 CLAUDE_CODE_PROCESS_WRAPPER を追加した。エージェントビューやバックグラウンドサービスにおいて、Claude Code が自身を起動する際に指定したラッパー実行ファイルを介して実行するようになり、企業向けのランチャーに対応した。
英語原文を表示
Added CLAUDE_CODE_PROCESS_WRAPPER: agent view and the background service now honor a corporate launcher by running every Claude Code self-spawn through a required wrapper executable

変更前

バックグラウンドで起動されるプロセスがシステムの標準的な方法で直接実行されていたため、特定のラッパー実行ファイルを介す必要がある企業内環境では動作が制限されることがあった。

変更後

この環境変数を設定することで、Claude Code がサブプロセスを生成する際に必ず指定の実行ファイルをラップして起動する。これによりセキュリティやポリシー管理用のランチャーとの統合が容易になる。

ユーザーへの恩恵

企業独自のセキュリティランチャー配下でも、バックグラウンドエージェントを正常に動作させられるようになります。

関連ドキュメント