feat: add missing hook events and fix existing hook fields#545
Merged
ashwin-ant merged 7 commits intomainfrom Feb 3, 2026
Merged
feat: add missing hook events and fix existing hook fields#545ashwin-ant merged 7 commits intomainfrom
ashwin-ant merged 7 commits intomainfrom
Conversation
Add support for previously missing hook event types: - Notification, SessionStart, SessionEnd, SubagentStart, PermissionRequest, and Setup hook events and their inputs - Corresponding hook-specific output types for each new event Update existing hook types with new fields: - Add tool_use_id to PreToolUse and PostToolUse hook inputs - Add additionalContext to PreToolUseHookSpecificOutput - Add updatedMCPToolOutput to PostToolUseHookSpecificOutput - Add agent_id, agent_transcript_path, agent_type to SubagentStopHookInput Remove outdated comment about SDK not supporting certain hook events. Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
wolffiex
approved these changes
Feb 3, 2026
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
Add 3 new hook events to
HookEvent(Notification,SubagentStart,PermissionRequest) with their input/output types. Also fix missing fields on existing hooks.New hook events
Notification— withNotificationHookInputandNotificationHookSpecificOutputSubagentStart— withSubagentStartHookInputandSubagentStartHookSpecificOutputPermissionRequest— withPermissionRequestHookInputandPermissionRequestHookSpecificOutputFixed fields on existing hooks
PreToolUseHookInput: addedtool_use_idPostToolUseHookInput: addedtool_use_idSubagentStopHookInput: addedagent_id,agent_transcript_path,agent_typePreToolUseHookSpecificOutput: addedadditionalContextPostToolUseHookSpecificOutput: addedupdatedMCPToolOutputNot included
SessionStart,SessionEnd, andSetupare not added — they fire in the CLI before the SDK connection is established, so SDK callbacks for them would never execute.Tests
PreToolUse(additionalContext, tool_use_id),PostToolUse(tool_use_id),Notification, and multi-hook registration