Skip to content

HookConfigAgent

Base classes

Name Children Inherits
ClaudeCodeBaseModel
clawd_code_sdk.models.base
Base model for all Claude Code Pydantic models.

⋔ Inheritance diagram

graph TD
  568199047["settings.HookConfigAgent"]
  2604142835["base.ClaudeCodeBaseModel"]
  3879467795["main.BaseModel"]
  2751680898["builtins.object"]
  2604142835 --> 568199047
  3879467795 --> 2604142835
  2751680898 --> 3879467795

🛈 DocStrings

Bases: ClaudeCodeBaseModel

Agent hook with multi-turn tool access for verification. See https://code.claude.com/docs/en/hooks#agent-based-hooks.

Source code in src/clawd_code_sdk/models/settings.py
class HookConfigAgent(ClaudeCodeBaseModel):
    """Agent hook with multi-turn tool access for verification. See https://code.claude.com/docs/en/hooks#agent-based-hooks."""

    model_config = ConfigDict(
        extra="forbid",
    )
    type: Literal["agent"] = "agent"
    """
    Hook type
    """
    prompt: str = Field(..., min_length=1)
    """
    Prompt describing what to verify. Use $ARGUMENTS placeholder for hook input JSON.
    """
    model: str | None = None
    """
    Model to use for evaluation. Defaults to a fast model
    """
    timeout: float | None = Field(None, gt=0.0)
    """
    Optional timeout in seconds (default: 60)
    """
    if_: str | None = Field(None, alias="if")
    """
    Optional permission-rule-syntax filter. 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
    """
    status_message: str | None = Field(None, alias="statusMessage")
    """
    Custom spinner message displayed while the hook runs
    """

if_ class-attribute instance-attribute

if_: str | None = Field(None, alias='if')

Optional permission-rule-syntax filter. 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

model class-attribute instance-attribute

model: str | None = None

Model to use for evaluation. Defaults to a fast model

prompt class-attribute instance-attribute

prompt: str = Field(..., min_length=1)

Prompt describing what to verify. Use $ARGUMENTS placeholder for hook input JSON.

status_message class-attribute instance-attribute

status_message: str | None = Field(None, alias='statusMessage')

Custom spinner message displayed while the hook runs

timeout class-attribute instance-attribute

timeout: float | None = Field(None, gt=0.0)

Optional timeout in seconds (default: 60)

type class-attribute instance-attribute

type: Literal['agent'] = 'agent'

Hook type

:fa-brands-github: Show source on GitHub