#[non_exhaustive]pub struct AutoMode {
pub allow: Option<Vec<String>>,
pub soft_deny: Option<Vec<String>>,
pub environment: Option<Vec<String>>,
pub hard_deny: Option<Vec<String>>,
pub classify_all_shell: Option<bool>,
pub extra: Extra,
}Expand description
autoMode: the auto-mode classifier’s sections. Each list replaces
the built-in one unless it holds the literal $defaults.
Add your own rules to what the auto mode classifier blocks and allows. Use it to tell the classifier which repos, buckets, and domains your organization trusts, so it stops blocking routine internal operations.
Docs: autoMode.
Fields (Non-exhaustive)§
This struct is marked as non-exhaustive
Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.allow: Option<Vec<String>>Rules for the auto mode classifier allow section. Replaces the built-in allow rules entirely unless the literal string “$defaults” is included as an entry, which splices the built-in defaults in at that position.
- Values: array of strings
- Default: unset
Docs: allow.
soft_deny: Option<Vec<String>>Rules for the auto mode classifier soft-deny section. Replaces the built-in soft-deny rules entirely unless the literal string “$defaults” is included as an entry, which splices the built-in defaults in at that position.
- Values: array of strings
- Default: unset
Docs: soft_deny.
environment: Option<Vec<String>>Entries for the auto mode classifier environment section. Replaces the built-in environment context entirely unless the literal string “$defaults” is included as an entry, which splices the built-in defaults in at that position.
- Values: array of strings
- Default: unset
Docs: environment.
hard_deny: Option<Vec<String>>Rules for the auto mode classifier hard-deny section. Hard-deny rules block unconditionally regardless of user intent. Replaces the built-in hard-deny rules entirely unless the literal string “$defaults” is included as an entry, which splices the built-in defaults in at that position.
- Values: array of strings
- Default: unset
Docs: hard_deny.
classify_all_shell: Option<bool>Send every Bash and PowerShell command through the auto mode classifier while auto mode
is active. By default, auto mode suspends only allow rules that could run arbitrary
code: tool-wide and wildcard rules such as Bash(*), and interpreter or shell-wrapper
prefixes such as Bash(python *). A command that any other allow rule matches, such as
Bash(npm test), skips the classifier unless it carries per-command allowed
domains.
- Values: Boolean
true: while auto mode is active, Claude Code sends every Bash and PowerShell command through the classifier and suspends your shell allow rules; outside auto mode the rules still applyfalse: auto mode suspends only allow rules that could run arbitrary code, such asBash(*)andBash(python *); a command that any other allow rule matches skips the classifier unless it carries per-command allowed domains, and every other shell command goes through it
- Default:
false - Scope: user or managed. Read wherever automode is read.
Docs: classifyAllShell.
extra: ExtraKeys Claude Code accepts here that this crate doesn’t model (newer or undocumented ones), kept as written so the document round-trips.