Skip to content

Add missing fields to Claude hook types#5

Merged
ashwin-corridor merged 1 commit into
mainfrom
update-claude-hook-types
Mar 2, 2026
Merged

Add missing fields to Claude hook types#5
ashwin-corridor merged 1 commit into
mainfrom
update-claude-hook-types

Conversation

@tanuj-corridor

@tanuj-corridor tanuj-corridor commented Feb 18, 2026

Copy link
Copy Markdown
Contributor

Summary

  • Updates existing Claude Code hook types to match the latest hooks reference
  • Adds missing fields to SessionStartInput, SubagentStopInput, PermissionRequestInput, PermissionRequestDecision, PreToolUseHookOutput, PostToolUseHookOutput, NotificationInput, and NotificationOutput
  • Promotes SubagentStopInput from a type alias to its own struct with AgentID, AgentType, AgentTranscriptPath
  • Adds new helpers: AllowWithContext, AllowPermissionWithPermissions, PostToolReplaceMCPOutput, NotificationContext

Test plan

  • All existing tests pass (go test ./...)
  • New helper tests added and passing
  • Verify JSON serialization matches Claude Code's expected schema

Open with Devin

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

@corridor-security corridor-security Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Corridor found no security issues!

@devin-ai-integration devin-ai-integration Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

✅ Devin Review: No Issues Found

Devin Review analyzed this PR and found no potential bugs to report.

View in Devin Review to see 5 additional findings.

Open in Devin Review

@corridor-security corridor-security Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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
ashwin-corridor merged commit 67e7749 into main Mar 2, 2026
2 checks passed
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