Skip to content

HookInput

Defined in: index.d.ts:67

The hook contract’s input: Claude Code’s hook input, in every harness.

[key: string]: unknown

optional cwd?: string

Defined in: index.d.ts:81


harness: string

Defined in: index.d.ts:78

The harness that ran the hook, e.g. “codex”.


hook_event_name: "SessionStart" | "SessionEnd" | "UserPromptSubmit" | "PreToolUse" | "PostToolUse" | "Stop" | "PreCompact"

Defined in: index.d.ts:69

Claude Code’s event name, e.g. “PreToolUse”.


optional last_assistant_message?: string

Defined in: index.d.ts:96


optional prompt?: string

Defined in: index.d.ts:83

Prompt submit: the user’s prompt.


optional session_id?: string

Defined in: index.d.ts:79


optional source?: string

Defined in: index.d.ts:93

Session start: what started it, e.g. “startup”.


optional stop_hook_active?: boolean

Defined in: index.d.ts:95

Stop: the agent is already continuing because a stop hook asked it to.


optional tool_input?: Record<string, unknown>

Defined in: index.d.ts:87

The tool’s input as Claude Code gives it: command for Bash, file_path for a file tool.


optional tool_kind?: "shell" | "read" | "write" | "mcp" | "other"

Defined in: index.d.ts:89

What the tool call does.


optional tool_name?: string

Defined in: index.d.ts:85

The tool, as Claude Code names it, e.g. “Bash”.


optional tool_response?: unknown

Defined in: index.d.ts:91

Post tool: the tool’s output.


optional transcript_path?: string

Defined in: index.d.ts:80