Skip to content

HookConfigPrompt

Base classes

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

⋔ Inheritance diagram

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

🛈 DocStrings

Bases: ClaudeCodeBaseModel

LLM prompt hook. See https://code.claude.com/docs/en/hooks#prompt-based-hooks.

Source code in src/clawd_code_sdk/models/settings.py
class HookConfigPrompt(ClaudeCodeBaseModel):
    """LLM prompt hook. See https://code.claude.com/docs/en/hooks#prompt-based-hooks."""

    model_config = ConfigDict(
        extra="forbid",
    )
    type: Literal["prompt"] = "prompt"
    """
    Hook type
    """
    prompt: str = Field(..., min_length=1)
    """
    Prompt to evaluate with LLM. 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: 30)
    """
    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
    """
    continue_on_block: bool | None = Field(False, alias="continueOnBlock")
    """
    When the prompt returns ok: false, feed the reason back to Claude and continue the turn instead of stopping. Implemented as continue: true on the resulting decision: "block". See https://code.claude.com/docs/en/hooks#prompt-hook-configuration
    """

continue_on_block class-attribute instance-attribute

continue_on_block: bool | None = Field(False, alias='continueOnBlock')

When the prompt returns ok: false, feed the reason back to Claude and continue the turn instead of stopping. Implemented as continue: true on the resulting decision: "block". See https://code.claude.com/docs/en/hooks#prompt-hook-configuration

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 to evaluate with LLM. 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: 30)

type class-attribute instance-attribute

type: Literal['prompt'] = 'prompt'

Hook type

:fa-brands-github: Show source on GitHub