Create Hook
Create hooks with brainstorming and security-first design
- Type
- Slash Command
- Repository
- athola/claude-night-market
- GitHub stars
- 339
- License
- MIT
- Repo last updated
- Sep 24, 2026
- Source file
- plugins/abstract/commands/create-hook.md
What Create Hook is
Create Hook is a slash command published in the athola/claude-night-market repository on GitHub, which has about 339 stars. The repository describes itself as: “23 Claude Code plugins: TDD enforcement hooks, git/PR workflows, spec-driven development, code review, project lifecycle, fix-from-error, maintenance automation, context optimization, research, and multi-LLM delegation. 186 skills, 128 commands, 54 agents.”
A slash command is a reusable prompt saved as a markdown file and run by typing its name after a slash. In Claude Code, custom commands have been merged into skills: a file in .claude/commands/ and a skill folder in .claude/skills/ both create the same kind of command, and existing command files keep working.
Create Hook gives you a repeatable way to run the same instructions without retyping them, optionally with arguments.
How to install Create Hook
Claude Code
- Download create-hook.md from the repository.
- Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md.
- Run it by typing / followed by its name.
Claude Cowork
- Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
- In Customize → Skills, click +, then upload the ZIP.
- Run it from any task with / and the skill name.
New to extending Cowork? Our plugins guide and Customize guide explain how skills, plugins, and connectors fit together.
Inside the source file
An excerpt from plugins/abstract/commands/create-hook.md, shared under the repository's MIT license. Read the full file on GitHub.
Creates new hooks through a structured workflow: iron-law → brainstorm → design → scaffold → validate. Uses Socratic questioning to refine rough ideas into well-designed, secure hooks before generating any files.
When To Use
Use this command when you need to:
- Creating a new hook from scratch
- Need security-first design guidance
- Want structured workflow for hook development with Socratic questioning
When NOT To Use
Avoid this command if:
- Evaluating existing hooks - use /hooks-eval instead
- Deciding where to place hooks - use hook-scope-guide skill
- Validating hook security - use /validate-hook instead
Usage
# Start with brainstorming (recommended)
/create-hook "detect when user shares sensitive files"
# Skip brainstorming if design is clear
/create-hook secret-detector --skip-brainstorm --event PreToolUse
# Create in specific plugin
/create-hook "auto-format on save" --plugin sanctum --event PostToolUseHook Event Types
Workflow
Phase -1: Iron Law Interlock (Blocking)
This phase is required and cannot be skipped.
Quick Reference
- Create test file FIRST: tests/hooks/test_${hook_name}.py
- Write structural tests: Hook file exists, valid JSON/Python, registered correctly
- Run tests - capture RED state:
pytest tests/hooks/test_${hook_name}.py -v
# Expected: FAILED (hook does not exist)- Capture evidence:
[E1] Command: pytest tests/hooks/test_${hook_name}.py -v
Output: FAILED - FileNotFoundError
Status: RED - Interlock satisfiedOnly after completing Phase -1 may you proceed.
Phase 0: Brainstorming (Default)
Before creating any files, refine the hook concept through collaborative dialogue.
Invoke the brainstorming skill:
Use superpowers:brainstorming to refine this hook idea before scaffolding.The brainstorming phase will:
- Understand the purpose - One question at a time:
- What behavior do you want to intercept or modify?
- Which hook event is appropriate? (present options with trade-offs)
- Should this block, modify, or observe?
- What data do you need from the hook payload?
- Explore security implications:
- What could go wrong if this hook misbehaves?
- What input validation is needed?
- Are there timeout considerations?
- Should this hook be blocking or non-blocking?
- Design the implementation:
- JSON declarative hook vs. executable script?
- If script: Python, Bash, or other?
- What shared utilities might this need?
- How will errors be handled?
- Validate the design - Present in sections:
- Hook configuration (JSON structure)
- Script logic (if applicable)
- Error handling approach
- Testing strategy
- Document the design:
- Write to docs/plans/YYYY-MM-DD- -design.md
- Include security considerations
- Commit the design document
Skip brainstorming with --skip-brainstorm only when:
- You have a written design document already
- The hook is a simple copy of an existing pattern
- You're making a minor modification to existing hooks
Phase 1: Gather Requirements
After brainstorming (or with --skip-brainstorm), the command prompts for:
- Hook name (if not provided)
- Must be kebab-case
- Descriptive of function (e.g., secret-detector, format-on-save)
- No generic names (my-hook, test-hook)
- Hook event type:
- One of the 8 supported events
- Explain the choice based on timing needs
- Hook type:
- declarative (JSON only): Simple matchers and conditions
- script (Python): Complex logic, external dependencies
- script (Bash): Shell operations, simple transformations
- Matcher pattern (for PreToolUse/PostToolUse):
- Tool name regex (e.g., Read|Write|Edit)
- Leave empty for all tools
- Timeout (for scripts):
- Default: 10 seconds
- Maximum: 60 seconds (with justification)
Phase 2: Security Review
Before scaffolding, validate security considerations:
Security Checklist:
[ ] Input validation for all payload fields
[ ] No shell injection vulnerabilities
[ ] No path traversal vulnerabilities
[ ] Timeout configured appropriately
[ ] Error handling doesn't leak secrets
[ ] Logging doesn't capture sensitive data Before you install
- Read the whole file first. Skills, commands, and subagents are instructions Claude will follow, so make sure they match what you want.
- Check which tools, scripts, or MCP servers it uses. Local servers and scripts run with your permissions.
- Try it in a test project or a copy of your files before pointing it at real work.
- Pin the version you tested, and review changes before updating.
- Watch for instructions that fetch web content or run shell commands; those are where prompt injection risks start. See our prompt injection guide.
FAQ
What is Create Hook?
Create Hook is a slash command for Claude Code and Claude Cowork from the athola/claude-night-market repository on GitHub. Create hooks with brainstorming and security-first design
How do I install Create Hook in Claude Code?
Download create-hook.md from the repository. Save it to ~/.claude/commands/ (all projects) or .claude/commands/ (one project). As a skill, you can instead save it as ~/.claude/skills/<name>/SKILL.md. Run it by typing / followed by its name.
Can I use Create Hook in Claude Cowork?
Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it. In Customize → Skills, click +, then upload the ZIP. Run it from any task with / and the skill name.
Is Create Hook safe to install?
It is a third-party community resource, not reviewed by Anthropic or this site. Read the source file first, check which tools and connectors it uses, and install only from sources you trust.
Similar resources
- Validate Pr Generate and self-execute a diff-derived test plan for a PR. Reads Slash Command · athola/claude-night-market
- War Room Convene a multi-LLM expert panel to pressure-test strategic decisions with adversarial review and reversibility assessment. Slash Command · athola/claude-night-market
- Voice Review Review existing text against a voice profile Slash Command · athola/claude-night-market
- Workflow Improvement Analysis Agent Analyzes a recreated workflow slice and produces multiple improvement Subagent · athola/claude-night-market
- Create Issue Create a new GitHub issue with formatted description, labels, and optional reference links Slash Command · athola/claude-night-market
- Create Command Create slash commands with brainstorming and best practices Slash Command · athola/claude-night-market
- Create Skill Scaffold new Claude Code skills with brainstorming, TDD methodology, and proper frontmatter and module structure. Slash Command · athola/claude-night-market
- Control Desktop Run a computer use task on the desktop via Claude's vision and action API Slash Command · athola/claude-night-market