settings.json

managedSourcesBehavior

string既定値first-wins記述場所管理者設定のみ

Claude Code が組織が配布する最優先の管理ソースのみを適用するか、配布されたすべての管理ソースを統合するかを選択する。

取りうる値

first-wins既定ポリシーキーを保持する最優先のソースがポリシーを供給し、下位のソースは Claude Code がすべての管理ソースから読み取るキーのみを提供する
merge配布されたすべての管理ソースがキーを提供し、以下のルールに従って結合される

記述例

{
  "managedSourcesBehavior": "merge"
}

使い方・用途

  • 複数の管理ソース(サーバー管理設定・MDM・managed-settings.json など)が配布されている環境で、その統合方法を制御する設定
  • デフォルトは "first-wins": ポリシーキーを持つ最優先ソースがポリシーを供給し、下位ソースはすべての管理ソースから読み取られるキーのみ寄与する
  • "merge" に設定すると、配布されたすべての管理ソースのキーが1つのポリシーに統合される
  • この設定は最上位のソースからのみ読み込まれ、下位のソースは自分自身を merge にオプトインできない
  • HKCU レジストリ(ユーザー書き込み可能)は他のソースと統合されない
  • Claude Code v2.1.242 以降が必要
英語原文(公式ドキュメントより)

Choose whether Claude Code applies only the highest-priority [managed source](/docs/en/managed-settings#how-claude-code-combines-managed-sources) your organization delivers, or combines every admin source it delivers. By default Claude Code takes the highest-priority source that carries a [policy key](/docs/en/managed-settings#how-claude-code-combines-managed-sources) and ignores the rest. A policy key is any settings key other than this one and wslInheritsWindowsSettings. So once server-managed settings or an MDM policy deliver a policy key, a managed-settings.json file contributes only the [keys Claude Code reads from every admin source](/docs/en/managed-settings#keys-read-from-every-admin-source). With "merge", every admin source you deliver contributes its keys to one combined policy. Requires Claude Code v2.1.242 or later.

関連する変更履歴

v2.1.257(1件)

Changed
「merge」モードの動作を変更し、sandbox.credentials.awsPairssandbox.ripgrep を各管理ソースの値を結合する代わりに、それらを設定した最上位の管理ソースからそのまま取得するようにしました。
英語原文を表示
Changed managedSourcesBehavior: "merge" to take sandbox.credentials.awsPairs and sandbox.ripgrep whole from the highest managed source that sets them instead of combining the sources' values

変更前

以前は「merge」モードにおいて、sandbox.credentials.awsPairssandbox.ripgrep は複数の管理ソースから値を結合していました。これにより、最上位のソースで設定されていない場合に、下位のソースの値が反映されることがありました。

変更後

現在は「merge」モードにおいて、sandbox.credentials.awsPairssandbox.ripgrep は、それらを設定した最上位の管理ソースからそのまま取得されます。下位のソースの値は無視されます。

ユーザーへの恩恵

設定の優先順位が明確になり、意図した管理ソースの設定のみが適用されるようになります。