II.
HookSurface JSON
Structured · livehook-surface:pre-compact
PreCompact (canonical) json
Inspect the normalized record payload exactly as the atlas UI reads it.
{
"id": "hook-surface:pre-compact",
"_kind": "HookSurface",
"_file": "channels-hooks/hook-surfaces/canonical/lifecycle-and-native-stubs.yaml",
"_cluster": "channels-hooks",
"attributes": {
"eventName": "PreCompact (canonical)",
"displayName": "PreCompact (canonical)",
"kind": "canonical",
"direction": "pre",
"blocking": true,
"family": "in-process",
"payloadSchema": {
"type": "object",
"required": [
"session_id",
"transcript_path",
"trigger"
],
"properties": {
"session_id": {
"type": "string"
},
"transcript_path": {
"type": "string"
},
"trigger": {
"type": "string",
"enum": [
"manual",
"auto"
],
"description": "manual = /compact slash command; auto = context-window pressure."
},
"custom_instructions": {
"type": "string",
"description": "Free-form user instructions accompanying a manual compaction."
}
}
},
"description": "Fires before a context-compaction step; can block or alter the compaction. Claude Code 1.0+."
},
"outgoingEdges": [],
"incomingEdges": [
{
"from": "agent-core-impl:claude-agent-sdk.core@current",
"to": "hook-surface:pre-compact",
"kind": "fires_hook",
"attributes": {}
},
{
"from": "agent-core-impl:claude-code.core@1.x",
"to": "hook-surface:pre-compact",
"kind": "fires_hook",
"attributes": {}
},
{
"from": "agent-runtime-impl:claude-code.runtime@1.x",
"to": "hook-surface:pre-compact",
"kind": "exposes",
"attributes": {}
},
{
"from": "hook-mapping:pre-compact-claude-code",
"to": "hook-surface:pre-compact",
"kind": "maps_hook",
"attributes": {}
},
{
"from": "hook-mapping:pre-compact-gemini",
"to": "hook-surface:pre-compact",
"kind": "maps_hook",
"attributes": {}
},
{
"from": "hook-mapping:compact-before-copilot",
"to": "hook-surface:pre-compact",
"kind": "maps_hook",
"attributes": {}
},
{
"from": "hook-surface:claude.pre-compact",
"to": "hook-surface:pre-compact",
"kind": "canonicalized_to",
"attributes": {}
}
]
}