#[non_exhaustive]pub struct AgentHook {
pub prompt: Option<String>,
pub model: Option<String>,
pub timeout: Option<f64>,
pub condition: Option<String>,
pub status_message: Option<String>,
pub extra: Extra,
}Expand description
An agent hook.
Docs: settings reference.
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.prompt: Option<String>Prompt text to send to the model. Use $ARGUMENTS as a placeholder for the hook input
JSON. Escape with a backslash to include literal text: \$1.00 renders as $1.00.
- Values: string
Docs: prompt.
model: Option<String>Model to use for evaluation. Defaults to the model Claude Code uses for background functionality.
- Values: string
Docs: model.
timeout: Option<f64>Seconds before canceling. Claude Code doesn’t enforce it on a command hook you run with
async: true.
Defaults: 600 for command, http, and mcp_tool; 30 for prompt; 60 for agent.
- Values: a number
Docs: timeout.
condition: Option<String>Permission rule
syntax to filter
when this hook runs, such as "Bash(git *)" or "Edit(*.ts)". The hook command only
runs if the tool call matches the pattern. See the Bash matching
table for how Bash patterns
evaluate against subcommands, $(), and backticks.
- Values: string
Docs: if.
status_message: Option<String>§extra: ExtraKeys Claude Code accepts here that this crate doesn’t model (newer or undocumented ones), kept as written so the document round-trips.