II.
HookSurface overview
Reference · livehook-surface:before-prompt-build
BeforePromptBuild (canonical) overview
Fires after the runtime has gathered the turn\'s inputs (user message, retrieved memory, attached files) but before the system + user prompt is assembled and sent to the model. Subscribers can rewrite or augment the assembly. Heaviest blocking-hook position for context engineering.
Attributes
eventName
BeforePromptBuild (canonical)
displayName
BeforePromptBuild (canonical)
kind
canonical
direction
pre
blocking
true
family
in-process
payloadSchema
type
object
required
- session_id
- turn_number
properties
session_id
type
string
turn_number
type
integer
pending_user_message
type
string
retrieved_context
type
array
items
type
object
memory_snippets
type
array
items
type
object
description
Fires after the runtime has gathered the turn\'s inputs (user message,
retrieved memory, attached files) but before the system + user prompt
is assembled and sent to the model. Subscribers can rewrite or
augment the assembly. Heaviest blocking-hook position for context
engineering.
Outgoing edges
None.
Incoming edges
exposes1
- agent-runtime-impl:claude-code.runtime@1.x·AgentRuntimeImplClaude Code Runtime (1.x)
maps_hook1
- hook-mapping:before-prompt-build-claude·HookMapping