Add missing fields to Claude hook types#5
Merged
Conversation
Update existing types to match the latest claude-hooks.md reference: - SessionStartInput: add Model, AgentType fields - SubagentStopInput: promote from alias to struct with AgentID, AgentType, AgentTranscriptPath - PermissionRequestInput: add PermissionSuggestions - PermissionRequestDecision: add UpdatedPermissions - PreToolUseHookOutput: add AdditionalContext - PostToolUseHookOutput: add UpdatedMCPToolOutput - NotificationInput: add Title - NotificationOutput: add HookSpecificOutput with AdditionalContext - BaseInput.PermissionMode: add dontAsk to docs - SessionEndInput.Reason: add bypass_permissions_disabled to docs New helpers: AllowWithContext, AllowPermissionWithPermissions, PostToolReplaceMCPOutput, NotificationContext
There was a problem hiding this comment.
Summary: This PR adds new helper functions to the Claude hooks API for allowing tool execution with context, replacing MCP tool output, updating permissions, and adding notification context. These are API enhancements that expand the hookshot library's capability to control AI agent behavior.
Risk: Low risk. The changes add new helper functions that generate structured JSON output for the Claude Code platform to interpret, but do not introduce input validation issues, command injection vectors, or exploitable security vulnerabilities. The helpers construct output types that are consumed by the Claude platform, not directly executed by hookshot.
ashwin-corridor
approved these changes
Mar 2, 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
SessionStartInput,SubagentStopInput,PermissionRequestInput,PermissionRequestDecision,PreToolUseHookOutput,PostToolUseHookOutput,NotificationInput, andNotificationOutputSubagentStopInputfrom a type alias to its own struct withAgentID,AgentType,AgentTranscriptPathAllowWithContext,AllowPermissionWithPermissions,PostToolReplaceMCPOutput,NotificationContextTest plan
go test ./...)