hook-authoring

Featured

Guide creating Claude Code hooks with security-first design. Use for validation and enforcement.

Code & Development 339 stars 35 forks Updated 2 days ago MIT

Install

View on GitHub

Quality Score: 94/100

Stars 20%
84
Recency 20%
100
Frontmatter 20%
70
Documentation 15%
100
Issue Health 10%
50
License 10%
100
Description 5%
100

Skill Content

## When NOT To Use - Auditing a hook that already exists (use `abstract:hooks-eval`) - Choosing where a hook should live (use `abstract:hook-scope-guide`) - Authoring a skill rather than a hook (use `abstract:skill-authoring`) # Hook Authoring Guide ## Overview Hooks are event interceptors that allow you to extend Claude Code and Claude Agent SDK behavior by executing custom logic at specific points in the agent lifecycle. They enable validation before tool use, logging after actions, context injection, workflow automation, and security enforcement. This skill teaches you how to write effective, secure, and performant hooks for both declarative JSON (Claude Code) and programmatic Python (Claude Agent SDK) use cases. ### Key Capabilities - **PreToolUse**: Validate, filter, or transform tool inputs before execution; inject context (2.1.9+) - **PostToolUse**: Log, analyze, or modify tool outputs after execution - **UserPromptSubmit**: Inject context or filter user messages before processing - **Stop/SubagentStop**: Cleanup, final reporting, or result aggregation - **TeammateIdle/TaskCompleted**: Multi-agent coordination and orchestration (2.1.33+) - **PreCompact**: State preservation before context window compaction > **New in 2.1.9**: PreToolUse hooks can now return `additionalContext` to inject information before a tool executes. This enables patterns like cache hints, security warnings, or relevant context injection. ## Quick Start ### Your First Hook (JSON - Claude...

Details

Author
athola
Repository
athola/claude-night-market
Created
10 months ago
Last Updated
2 days ago
Language
Python
License
MIT

Bundled in these plugins

Similar Skills

Semantically similar based on skill content — not just same category

AI & Automation Listed

hook-development

This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.

5 Updated 1 weeks ago
ValorVie
AI & Automation Listed

hook-development

This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.

0 Updated 5 days ago
mrkhachaturov
AI & Automation Solid

hook-development

This skill should be used when the user asks to "create a hook", "add a PreToolUse/PostToolUse/Stop hook", "validate tool use", "implement prompt-based hooks", "use ${CLAUDE_PLUGIN_ROOT}", "set up event-driven automation", "block dangerous commands", or mentions hook events (PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, Notification). Provides comprehensive guidance for creating and implementing Claude Code plugin hooks with focus on advanced prompt-based hooks API.

47 Updated yesterday
thevibeworks