環境変数
ANTHROPIC_CONFIG_DIR
設定ファイルの格納ディレクトリを指定しますが、起動時にのみ読み込まれ、セッション実行中の動的な変更は反映されません。
使い方・用途
- 起動時のみ適用されるため、実行中のセッションで値を変更しても設定ディレクトリの参照先は維持されます
- v2.1.223以降で設定を反映させるにはMDMやmanaged-settings.jsonによる管理が推奨されます
- セキュリティ保護のため、キャッシュされた環境変数はサーバーからのペイロード確認が完了するまで適用されない仕様となっています
英語原文(公式ドキュメントより)
Claude Code reads the Workload Identity Federation variables and the ANTHROPIC_PROFILE and ANTHROPIC_CONFIG_DIR selectors only at startup, so a server-delivered value for them doesn't switch the session's credential source even after the fetch succeeds. To deliver those selectors on Claude Code v2.1.223 or later, use endpoint-managed settings such as MDM or managed-settings.json. For CLAUDE_CONFIG_DIR and the operating-system directory variables, the withholding itself is the protection: the cached value stays out of the environment until the server confirms the payload.