pub struct ClaudeCodeOptions {Show 17 fields
pub system_prompt: Option<String>,
pub append_system_prompt: Option<String>,
pub allowed_tools: Vec<String>,
pub disallowed_tools: Vec<String>,
pub permission_mode: PermissionMode,
pub mcp_servers: HashMap<String, McpServerConfig>,
pub mcp_tools: Vec<String>,
pub max_turns: Option<i32>,
pub max_thinking_tokens: i32,
pub model: Option<String>,
pub cwd: Option<PathBuf>,
pub continue_conversation: bool,
pub resume: Option<String>,
pub permission_prompt_tool_name: Option<String>,
pub settings: Option<String>,
pub add_dirs: Vec<PathBuf>,
pub extra_args: HashMap<String, Option<String>>,
}Expand description
Configuration options for Claude Code SDK
Fields§
§system_prompt: Option<String>System prompt to prepend to all messages
append_system_prompt: Option<String>Additional system prompt to append
allowed_tools: Vec<String>List of allowed tools
disallowed_tools: Vec<String>List of disallowed tools
permission_mode: PermissionModePermission mode for tool execution
mcp_servers: HashMap<String, McpServerConfig>MCP server configurations
mcp_tools: Vec<String>MCP tools to enable
max_turns: Option<i32>Maximum number of conversation turns
max_thinking_tokens: i32Maximum thinking tokens
model: Option<String>Model to use
cwd: Option<PathBuf>Working directory
continue_conversation: boolContinue from previous conversation
resume: Option<String>Resume from a specific conversation ID
permission_prompt_tool_name: Option<String>Custom permission prompt tool name
settings: Option<String>Settings file path for Claude Code CLI
add_dirs: Vec<PathBuf>Additional directories to add as working directories
extra_args: HashMap<String, Option<String>>Extra arbitrary CLI flags
Implementations§
Source§impl ClaudeCodeOptions
impl ClaudeCodeOptions
Sourcepub fn builder() -> ClaudeCodeOptionsBuilder
pub fn builder() -> ClaudeCodeOptionsBuilder
Create a new options builder
Trait Implementations§
Source§impl Clone for ClaudeCodeOptions
impl Clone for ClaudeCodeOptions
Source§fn clone(&self) -> ClaudeCodeOptions
fn clone(&self) -> ClaudeCodeOptions
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 ClaudeCodeOptions
impl Debug for ClaudeCodeOptions
Source§impl Default for ClaudeCodeOptions
impl Default for ClaudeCodeOptions
Source§fn default() -> ClaudeCodeOptions
fn default() -> ClaudeCodeOptions
Returns the “default value” for a type. Read more
Auto Trait Implementations§
impl Freeze for ClaudeCodeOptions
impl RefUnwindSafe for ClaudeCodeOptions
impl Send for ClaudeCodeOptions
impl Sync for ClaudeCodeOptions
impl Unpin for ClaudeCodeOptions
impl UnwindSafe for ClaudeCodeOptions
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> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
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