PostToolBatch API

July 14, 2026 ยท View on GitHub

Available when inheriting from ClaudeHooks::PostToolBatch:

Runs after a full batch of tool calls completes. Can block Claude from continuing.

Input Helpers

๐Ÿ“š Shared input helpers

MethodDescription
tool_callsArray of tool call results; each entry has tool_name, tool_input, tool_use_id, tool_response

Hook State Helpers

๐Ÿ“š Shared hook state methods

MethodDescription
block!(reason)Block Claude from continuing after this batch
add_additional_context!(context)Add additional context visible to Claude

Output Helpers

๐Ÿ“š Shared output helpers

MethodDescription
output.blocked?Check if the batch was blocked
output.decisionGet the decision ('block' or nil)
output.reasonGet the block reason

Hook Exit Codes

Exit CodeBehavior
exit 0Claude continues
exit 2Blocks Claude; STDERR shown to Claude