pub enum SettingSource {
User,
Project,
Local,
}Expand description
Controls which filesystem-based configuration sources the SDK loads settings from.
When setting_sources is omitted or None in ClaudeAgentOptions, the SDK does
not load any filesystem settings, providing isolation for SDK applications.
§Variants
User— Global user settings (~/.claude/settings.json).Project— Shared project settings (.claude/settings.json), version controlled. Must be included to loadCLAUDE.mdfiles.Local— Local project settings (.claude/settings.local.json), typically gitignored.
§Precedence
When multiple sources are loaded, settings merge with this precedence (highest first):
- Local settings
- Project settings
- User settings
Programmatic options (e.g., agents, allowed_tools) always override filesystem settings.
Variants§
User
Load user-level settings from the home directory.
Project
Load project-level shared settings.
Local
Load local project settings (typically not committed).
Trait Implementations§
Source§impl Clone for SettingSource
impl Clone for SettingSource
Source§fn clone(&self) -> SettingSource
fn clone(&self) -> SettingSource
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for SettingSource
impl Debug for SettingSource
Source§impl<'de> Deserialize<'de> for SettingSource
impl<'de> Deserialize<'de> for SettingSource
Source§fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
fn deserialize<__D>(__deserializer: __D) -> Result<Self, __D::Error>where
__D: Deserializer<'de>,
Deserialize this value from the given Serde deserializer. Read more
Source§impl PartialEq for SettingSource
impl PartialEq for SettingSource
Source§impl Serialize for SettingSource
impl Serialize for SettingSource
impl Eq for SettingSource
impl StructuralPartialEq for SettingSource
Auto Trait Implementations§
impl Freeze for SettingSource
impl RefUnwindSafe for SettingSource
impl Send for SettingSource
impl Sync for SettingSource
impl Unpin for SettingSource
impl UnsafeUnpin for SettingSource
impl UnwindSafe for SettingSource
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more