pub struct ClaudeSettings {
pub mcp_servers: Option<HashMap<String, McpServerConfig>>,
pub hooks: Option<Value>,
pub permissions: Option<Value>,
pub other: HashMap<String, Value>,
}Expand description
Settings structure for .claude/settings.local.json.
This represents the complete settings file that may contain various configurations.
Fields§
§mcp_servers: Option<HashMap<String, McpServerConfig>>Map of server names to their configurations
hooks: Option<Value>Hook configurations for event-based automation
permissions: Option<Value>Permissions configuration
other: HashMap<String, Value>Other settings preserved from the original file
Implementations§
Source§impl ClaudeSettings
impl ClaudeSettings
Sourcepub fn load_or_default(path: &Path) -> Result<Self>
pub fn load_or_default(path: &Path) -> Result<Self>
Load an existing .claude/settings.local.json file or create a new configuration.
This method preserves all existing configurations.
Sourcepub fn save(&self, path: &Path) -> Result<()>
pub fn save(&self, path: &Path) -> Result<()>
Save the settings to .claude/settings.local.json file.
The file is written atomically to prevent corruption.
Sourcepub fn update_mcp_servers(&mut self, mcp_servers_dir: &Path) -> Result<()>
pub fn update_mcp_servers(&mut self, mcp_servers_dir: &Path) -> Result<()>
Update MCP servers from stored configurations.
This method loads all MCP server configurations from the specified directory and merges them into the settings, preserving user-managed servers.
Trait Implementations§
Source§impl Debug for ClaudeSettings
impl Debug for ClaudeSettings
Source§impl Default for ClaudeSettings
impl Default for ClaudeSettings
Source§fn default() -> ClaudeSettings
fn default() -> ClaudeSettings
Returns the “default value” for a type. Read more
Source§impl<'de> Deserialize<'de> for ClaudeSettings
impl<'de> Deserialize<'de> for ClaudeSettings
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
Auto Trait Implementations§
impl Freeze for ClaudeSettings
impl RefUnwindSafe for ClaudeSettings
impl Send for ClaudeSettings
impl Sync for ClaudeSettings
impl Unpin for ClaudeSettings
impl UnwindSafe for ClaudeSettings
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
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left is true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
Converts
self into a Left variant of Either<Self, Self>
if into_left(&self) returns true.
Converts self into a Right variant of Either<Self, Self>
otherwise. Read more