
Claude Hook Writer
If you're writing Claude Code hooks, this walks you through the entire lifecycle from design decisions to deployment. It's structured around progressive disclosure, loading detailed references only when you need them, which reportedly cuts token usage by 55%. The core content focuses on five specific pitfalls that break hooks in production: unquoted variables failing on filenames with spaces, missing input validation enabling path traversal, synchronous operations blocking Claude for 30+ seconds, using exit 1 instead of exit 2 so PreToolUse hooks don't actually block, and assuming dependencies exist. Good for both writing new hooks and debugging why existing ones fail intermittently.
- skills.sh installs
- 408
- GitHub stars
- 248
- last updated
- Aug 21, 2026
Install
$ npx -y skills add secondsky/claude-skills --skill claude-hook-writer --agent claude-codeInstalls into .claude/skills of the current project.
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.
Sponsors
Details
- Repository
- github.com/secondsky/claude-skills
- Categories
- Frontend Development, Documentation, Debugging, Design & UI/UX
- First seen
- Jun 3, 2026
More from secondsky/claude-skills
All 146- Logging Best Practices408
- Cloudflare Manager407
- Plan Interview406
- Ml Pipeline Automation402
- Nuxt Core401
- Nuxt Data400
- Microservices Patterns398
- Multi Ai Consultant397
- Graphql Implementation393
- Mcp Management393
- Model Deployment393
- Jest Generator391
- Cloudflare Agents389
- Cloudflare Mcp Server388
- Thesys Generative Ui384
- Access Control Rbac381
- Maz Ui380
- React Best Practices380
- Woocommerce Backend Dev379
- Woocommerce Code Review379
- Bun Hono Integration376
- Bun Test Basics375
- Woocommerce Copy Guidelines374
- Woocommerce Dev Cycle374