Skip to content

feat: add missing hook events and fix existing hook fields#545

Merged
ashwin-ant merged 7 commits intomainfrom
ashwin/add-missing-hook-types
Feb 3, 2026
Merged

feat: add missing hook events and fix existing hook fields#545
ashwin-ant merged 7 commits intomainfrom
ashwin/add-missing-hook-types

Conversation

@ashwin-ant
Copy link
Collaborator

@ashwin-ant ashwin-ant commented Feb 2, 2026

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 — with NotificationHookInput and NotificationHookSpecificOutput
  • SubagentStart — with SubagentStartHookInput and SubagentStartHookSpecificOutput
  • PermissionRequest — with PermissionRequestHookInput and PermissionRequestHookSpecificOutput

Fixed fields on existing hooks

  • PreToolUseHookInput: added tool_use_id
  • PostToolUseHookInput: added tool_use_id
  • SubagentStopHookInput: added agent_id, agent_transcript_path, agent_type
  • PreToolUseHookSpecificOutput: added additionalContext
  • PostToolUseHookSpecificOutput: added updatedMCPToolOutput

Not included

SessionStart, SessionEnd, and Setup are not added — they fire in the CLI before the SDK connection is established, so SDK callbacks for them would never execute.

Tests

  • Unit tests for all new type constructions and hook callback flows
  • E2e tests for PreToolUse (additionalContext, tool_use_id), PostToolUse (tool_use_id), Notification, and multi-hook registration

ashwin-ant and others added 6 commits February 2, 2026 10:08
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>
@ashwin-ant ashwin-ant changed the title feat: add missing hook event types and update hook inputs feat: add missing hook events and fix existing hook fields Feb 2, 2026
@ashwin-ant ashwin-ant enabled auto-merge (squash) February 3, 2026 19:17
@ashwin-ant ashwin-ant merged commit 1a832b8 into main Feb 3, 2026
14 of 16 checks passed
@ashwin-ant ashwin-ant deleted the ashwin/add-missing-hook-types branch February 3, 2026 19:25
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants