-
Notifications
You must be signed in to change notification settings - Fork 0
Open
Labels
enhancementNew feature or requestNew feature or requesthooksHooks systemHooks systempriority-criticalCritical priority - implement firstCritical priority - implement first
Description
Summary
Implement a hooks system that allows intercepting tool execution before and after it happens.
Why It's Needed
- Safety: Block dangerous commands before execution
- Backup: Create file backups before modifications
- Security: Prevent credential exposure
- Extensibility: Enable plugins and custom workflows
Hook Types to Implement
PreToolUse
- Fires before any tool executes
- Can block, allow, or modify tool input
- Returns:
{ decision: "allow" | "deny" | "ask", modifiedInput?, message? }
PostToolUse
- Fires after tool completes
- Can log results, provide feedback, trigger follow-up
- Returns:
{ feedback?, metadata? }
Configuration Format
{
"hooks": {
"PreToolUse": [
{
"name": "security-check",
"matcher": "bash|write|edit",
"script": ".codetyper/hooks/security.ts"
}
]
}
}Acceptance Criteria
- Hook registration and discovery
- PreToolUse hook with allow/deny/ask decisions
- PostToolUse hook with feedback support
- Matcher patterns for tool filtering
- Timeout handling for hooks
- Built-in hook examples
Effort Estimate
3 days
References
- Claude Code: 10 hook types
- OpenCode: 12+ hook types
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
enhancementNew feature or requestNew feature or requesthooksHooks systemHooks systempriority-criticalCritical priority - implement firstCritical priority - implement first