pub struct Config {Show 27 fields
pub prompt: String,
pub model: Option<String>,
pub fallback_model: Option<String>,
pub effort: Option<Effort>,
pub agent: Option<String>,
pub permissions: Permissions,
pub permission_mode: Option<PermissionMode>,
pub allow_tools: Vec<String>,
pub deny_tools: Vec<String>,
pub session: Session,
pub fork: bool,
pub worktree: Option<Option<String>>,
pub max_turns: Option<u32>,
pub max_budget_usd: Option<f64>,
pub timeout_secs: Option<u64>,
pub json_schema: Option<String>,
pub system_prompt: Option<String>,
pub append_system_prompt: Option<String>,
pub agent_notice: Option<String>,
pub no_agent_notice: bool,
pub no_retry: bool,
pub no_session_persistence: bool,
pub bare: bool,
pub safe_mode: bool,
pub add_dir: Vec<String>,
pub mcp_config: Vec<String>,
pub strict_mcp_config: bool,
}Expand description
A config-and-run request: everything run needs to send one prompt
through claude and hand back the typed result. The prompt is the final,
already-composed text (the CLI does attach/git/var composition before
building this).
Fields§
§prompt: StringThe fully-composed prompt to send.
model: Option<String>Override the model for this run (None = claude’s default).
fallback_model: Option<String>Fallback model when the primary is overloaded (--fallback-model).
effort: Option<Effort>Reasoning-effort level (None = claude’s default). The CLI maps its
--effort value to this claude-wrapper type in build_config.
agent: Option<String>Run under a named subagent definition (--agent).
permissions: PermissionsPermission posture (default read-only).
permission_mode: Option<PermissionMode>A specific claude permission mode composed on top of the posture. None
leaves claude’s default. Ignored under Permissions::FullAuto, which
bypasses all checks before the mode is read. The CLI maps its
--permission-mode value to this claude-wrapper type in build_config.
allow_tools: Vec<String>Extra allowed tool patterns layered on top of the posture.
deny_tools: Vec<String>Tool patterns to block (ignored under Permissions::FullAuto).
session: SessionSession continuity (default a fresh session).
fork: boolBranch the resumed session instead of continuing it in place. Only
meaningful with Session::Resume.
worktree: Option<Option<String>>Run in a git worktree: None = no worktree, Some(None) = a fresh
anonymous worktree, Some(Some(name)) = a named worktree.
max_turns: Option<u32>Cap the agentic turn count (None = uncapped).
max_budget_usd: Option<f64>Cap total spend in USD (None = uncapped).
timeout_secs: Option<u64>Wall-clock deadline in seconds (None or 0 = no deadline).
json_schema: Option<String>Constrain output to a JSON Schema. The value is the inline schema JSON (not a path – the CLI’s path-reading sugar is its own concern).
system_prompt: Option<String>Replace claude’s system prompt (--system-prompt). None keeps it.
append_system_prompt: Option<String>Append to the system prompt (--append-system-prompt); composed with
the agent notice below into one appended block.
agent_notice: Option<String>Override the built-in single-turn agent-notice text (--agent-notice).
Some("") disables the notice (as does no_agent_notice); None uses
the built-in text.
no_agent_notice: boolSuppress the built-in single-turn agent notice (--no-agent-notice).
Default false – the notice is injected, faithful to the CLI default.
no_retry: boolFail fast on a transient error instead of retrying (--no-retry): a
single attempt, no backoff.
no_session_persistence: boolDo not persist the session to claude’s history
(--no-session-persistence).
bare: boolBare mode (--bare): the minimal claude invocation.
safe_mode: boolSafe mode (--safe-mode): claude’s extra guardrails.
add_dir: Vec<String>Extra tool-access directories (--add-dir), forwarded verbatim.
mcp_config: Vec<String>MCP server config files (--mcp-config), forwarded verbatim.
strict_mcp_config: boolUse only the servers in mcp_config, ignoring other MCP sources
(--strict-mcp-config).