II.
HookSurface JSON
Structured · livehook-surface:before-prompt-build
BeforePromptBuild (canonical) json
Inspect the normalized record payload exactly as the atlas UI reads it.
{
"id": "hook-surface:before-prompt-build",
"_kind": "HookSurface",
"_file": "channels-hooks/hook-surfaces/canonical/missing-canonical-hooks.yaml",
"_cluster": "channels-hooks",
"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,\nretrieved memory, attached files) but before the system + user prompt\nis assembled and sent to the model. Subscribers can rewrite or\naugment the assembly. Heaviest blocking-hook position for context\nengineering.\n"
},
"outgoingEdges": [],
"incomingEdges": [
{
"from": "agent-runtime-impl:claude-code.runtime@1.x",
"to": "hook-surface:before-prompt-build",
"kind": "exposes",
"attributes": {}
},
{
"from": "hook-mapping:before-prompt-build-claude",
"to": "hook-surface:before-prompt-build",
"kind": "maps_hook",
"attributes": {}
}
]
}