Claude Hook Writer
Security-first guide for writing, reviewing, and debugging Claude Code hooks, covering event choice, matchers, and exit codes.
- CCM score
- 58 of 100
- skills.sh installs
- 417
- GitHub stars
- 257
- last updated
- Aug 21, 2026
Own this skill? Claim it
What it does
- Covers hook design decisions: which event to target, which tools to match, command versus prompt type, and exit code meaning
- Includes the top five pitfalls (unquoted variables, unvalidated input, slow blocking hooks, wrong exit codes, missing tools) with fixes
- Enforces validation of JSON stdin, path traversal checks, and a 100ms target for PreToolUse hooks
- Designed for developers building, auditing, or troubleshooting Claude Code hooks in shell or prompt form
Install
$ npx -y skills add secondsky/claude-skills --skill claude-hook-writer -yInstalls into .agents/skills for every agent it finds here, and .claude/skills for Claude Code.
Files
Claude Hook Writer
Status: Production Ready Version: 2.0.0 (Optimized with progressive disclosure) Last Updated: 2025-12-17
Overview
Expert guidance for writing secure, reliable, and performant Claude Code hooks. This skill validates design decisions, enforces best practices, and prevents common pitfalls.
When to Use This Skill
- Designing a new Claude Code hook
- Reviewing existing hook code
- Debugging hook failures
- Optimizing slow hooks
- Securing hooks that handle sensitive data
- Publishing hooks as PRPM packages
Core Principles
1. Security is Non-Negotiable
Hooks execute automatically with user permissions and can read, modify, or delete any file the user can access.
ALWAYS validate and sanitize all input. Hooks receive JSON via stdin—never trust it blindly.
For complete security patterns: Load references/security-requirements.md when implementing validation or securing hooks.
2. Reliability Over Features
A hook that works 99% of the time is a broken hook. Edge cases (Unicode filenames, spaces in paths, missing tools) will happen.
Test with edge cases before deploying.
Details
- Repository
- github.com/secondsky/claude-skills
- Categories
- Skill & Plugin Building, CLI & Terminal, Security
- First seen
- Jun 3, 2026
Questions
What does the claude-hook-writer skill do?
The claude-hook-writer skill gives expert guidance for writing secure, reliable, and performant Claude Code hooks. It checks design decisions, enforces best practices, and helps prevent common pitfalls when creating, reviewing, or debugging hooks.
How do I install the claude-hook-writer skill?
Run npx -y skills add secondsky/claude-skills --skill claude-hook-writer -y in your project. Once installed, the agent can guide you through designing, reviewing, and debugging Claude Code hooks.
Who is the claude-hook-writer skill for?
It is for developers who create, review, or debug Claude Code hooks. The skill covers choosing the right event, matcher, and exit code, validating JSON input, and keeping hooks fast and safe.
Where does claude-hook-writer stand in its category?
It is listed under Skill and Plugin Building on Claude Marketplaces, alongside skills such as find-skills, writing-for-agents, and skill-creator. Its focus is narrower, on writing Claude Code hooks specifically.
More from secondsky/claude-skills
All 116- Logging Best Practices417
- Claude Code Bash Patterns416
- Bun React Ssr415
- Bun Shell415
- Plan Interview415
- Bun Websocket Server413
- Bun Redis411
- Ml Pipeline Automation411
- Nuxt Core410
- Nuxt Data410
- Bun Ffi408
- Bun Nuxt408
- Bun Jest Migration407
- Bun Macros406
- Multi Ai Consultant406
- Graphql Implementation402
- Model Deployment402
- Jest Generator401
- Thesys Generative Ui392
- Nuxt Studio390
- Maz Ui389
- Woocommerce Code Review388
- Woocommerce Backend Dev387
- Woocommerce Copy Guidelines383
Similar to Claude Hook Writer
More Skill & Plugin Buildinghook-developmentSkillanthropics/claude-plugins-official8.3K installsGuide for writing Claude Code plugin hooks, covering prompt-based and command hook types across lifecycle events.
writing-hookify-rulesSkillanthropics/claude-plugins-official8.1K installsGuide to writing hookify rule files, covering frontmatter fields, event types, and regex pattern tips.
creating-claude-hooksSkillagentworkforce/relay1.2K starsGuide for building executable Claude Code hooks, covering event types, I/O format, and PRPM packaging.
claude-code-bash-patternsSkillsecondsky/claude-skills416 installsBash command patterns, PreToolUse hooks, and git workflows for Claude Code, with security guardrails and CLI integration.
security-guidancePluginalirezarezvani/claude-skills30.7K starsPreToolUse security reminder hook for Claude Code. Catches 12 common security anti-patterns in Edit/Write/MultiEdit operations BEFORE they happen — command inje
hook-developerSkillparcadei/continuous-claude-v3507 installsComplete Claude Code hook reference covering input and output schemas for every event, plus registration and testing.