Skip to main content

Module inputs

Module inputs 

Source
Expand description

Typed input payloads for each hook event.

Every concrete input flattens BaseHookInput so callbacks can access session_id, transcript_path, cwd, and (optionally) permission_mode without reaching back into super::HookContext.

Re-exportsยง

use serde::Deserialize; ๐Ÿ”’
use serde::Deserialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde::Serialize; ๐Ÿ”’
use serde_json::Value; ๐Ÿ”’

Structsยง

BaseHookInput
Fields shared by every hook input the CLI emits. Every concrete input type below flattens this struct so callbacks can access session_id, transcript_path, cwd, and (optionally) permission_mode without reaching back into super::HookContext.
EffortInfo
Wrapper for the effort field on hook inputs. Currently only carries level but kept as a struct so future fields (budget, adaptive flags, โ€ฆ) can be added without breaking decode-side pattern matches.
NotificationInput
Input payload for Notification.
PermissionRequestInput
Input payload for PermissionRequest.
PostToolUseFailureInput
Input payload for PostToolUseFailure.
PostToolUseInput
Input payload for PostToolUse.
PreCompactInput
Input payload for PreCompact.
PreToolUseInput
Input payload for PreToolUse.
StopInput
Input payload for Stop.
SubagentContext
Optional sub-agent attribution present on tool-lifecycle hook inputs (PreToolUse, PostToolUse, PostToolUseFailure, PermissionRequest). Fields are populated when the hook fires inside a Task-spawned sub-agent so tool events can be attributed back to the right agent when multiple sub-agents interleave over the same control channel.
SubagentStartInput
Input payload for SubagentStart.
SubagentStopInput
Input payload for SubagentStop.
UserPromptSubmitInput
Input payload for UserPromptSubmit.