#[non_exhaustive]pub struct HttpHook {
pub url: Option<String>,
pub headers: Option<BTreeMap<String, String>>,
pub allowed_env_vars: Option<Vec<String>>,
pub timeout: Option<f64>,
pub condition: Option<String>,
pub status_message: Option<String>,
pub on_failure: Option<HookOnFailure>,
pub extra: Extra,
}Expand description
An http 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.url: Option<String>§headers: Option<BTreeMap<String, String>>Additional HTTP headers as key-value pairs. Values support environment variable
interpolation using $VAR_NAME or ${VAR_NAME} syntax. Only variables listed in
allowedEnvVars are resolved.
- Values: object
Docs: headers.
allowed_env_vars: Option<Vec<String>>List of environment variable names that may be interpolated into header values. References to unlisted variables are replaced with empty strings. Required for any env var interpolation to work.
- Values: array of strings
Docs: allowedEnvVars.
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>§on_failure: Option<HookOnFailure>What happens to the action when the hook fails: "continue", the default, or "block".
See Block the action when a hook
fails.
Requires Claude Code v2.1.295 or later.
- Values:
"continue"or"block". Requires Claude Code v2.1.295 or later - Default:
"continue"
Docs: onFailure.
extra: ExtraKeys Claude Code accepts here that this crate doesn’t model (newer or undocumented ones), kept as written so the document round-trips.