HookConfigCommand
Base classes¶
| Name | Children | Inherits |
|---|---|---|
| ClaudeCodeBaseModel clawd_code_sdk.models.base Base model for all Claude Code Pydantic models. |
⋔ Inheritance diagram¶
graph TD
1496997270["settings.HookConfigCommand"]
2604142835["base.ClaudeCodeBaseModel"]
3879467795["main.BaseModel"]
2751680898["builtins.object"]
2604142835 --> 1496997270
3879467795 --> 2604142835
2751680898 --> 3879467795
🛈 DocStrings¶
Bases: ClaudeCodeBaseModel
Bash command hook.
Source code in src/clawd_code_sdk/models/settings.py
args
class-attribute
instance-attribute
¶
Argument list for exec form. When present, spawns the command directly without shell interpretation — each element is passed as-is, so path placeholders never need quoting. See https://code.claude.com/docs/en/hooks#command-hook-fields
async_
class-attribute
instance-attribute
¶
Run this hook asynchronously without blocking Claude Code
async_rewake
class-attribute
instance-attribute
¶
When true, the hook runs in the background and wakes the model when it exits with code 2. Implies async.
command
class-attribute
instance-attribute
¶
Shell command to execute
if_
class-attribute
instance-attribute
¶
Optional permission-rule-syntax filter (e.g., "Bash(git *)"). Evaluated only on tool-related events (PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest, PermissionDenied); on other events a hook with if set never runs. See https://code.claude.com/docs/en/hooks-guide#filter-hooks-with-matchers
on_failure
class-attribute
instance-attribute
¶
Whether the action that triggered the hook goes ahead when the hook fails: it can't start, exits with a code other than 0 or 2, times out, or prints invalid JSON. "block" does what exit code 2 does on that event, and denies the request on PermissionRequest. Leaving it unset isn't always the same as "continue". No effect on Stop, SubagentStop, TaskCompleted, and TeammateIdle hooks, or when async or asyncRewake is set. Requires Claude Code v2.1.295 or later. See https://code.claude.com/docs/en/hooks#block-the-action-when-a-hook-fails
shell
class-attribute
instance-attribute
¶
Shell interpreter for the command. "bash" uses the login shell (bash/zsh/sh); "powershell" uses pwsh. Defaults to bash.
status_message
class-attribute
instance-attribute
¶
Custom spinner message displayed while the hook runs
timeout
class-attribute
instance-attribute
¶
Optional timeout in seconds (default: 600; lowered to 30 on UserPromptSubmit and 10 on MessageDisplay)