Sponsor Suno AI Music arrow_forward
Slash Command

Create Hook

Create hooks with brainstorming and security-first design

Type
Slash Command
GitHub stars
339
License
MIT
Repo last updated
Sep 24, 2026

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

  1. Download create-hook.md from the repository.
  2. 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.
  3. Run it by typing / followed by its name.

Claude Cowork

  1. Turn the command into a skill: create a folder with the file saved as SKILL.md and zip it.
  2. In Customize → Skills, click +, then upload the ZIP.
  3. 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 PostToolUse

Hook Event Types

Workflow

Phase -1: Iron Law Interlock (Blocking)

This phase is required and cannot be skipped.

Quick Reference

  1. Create test file FIRST: tests/hooks/test_${hook_name}.py
  2. Write structural tests: Hook file exists, valid JSON/Python, registered correctly
  3. Run tests - capture RED state:
   pytest tests/hooks/test_${hook_name}.py -v
   # Expected: FAILED (hook does not exist)
  1. Capture evidence:
   [E1] Command: pytest tests/hooks/test_${hook_name}.py -v
   Output: FAILED - FileNotFoundError
   Status: RED - Interlock satisfied

Only 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:

  1. 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?
  1. 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?
  1. 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?
  1. Validate the design - Present in sections:
  • Hook configuration (JSON structure)
  • Script logic (if applicable)
  • Error handling approach
  • Testing strategy
  1. 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:

  1. 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)
  1. Hook event type:
  • One of the 8 supported events
  • Explain the choice based on timing needs
  1. Hook type:
  • declarative (JSON only): Simple matchers and conditions
  • script (Python): Complex logic, external dependencies
  • script (Bash): Shell operations, simple transformations
  1. Matcher pattern (for PreToolUse/PostToolUse):
  • Tool name regex (e.g., Read|Write|Edit)
  • Leave empty for all tools
  1. 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

Browse all skills, subagents, and plugins →

Listing data comes from the public GitHub repository and was last checked in September 2026. Excerpts are © their authors and shared under MIT. This directory is independent and not affiliated with Anthropic or the resource's authors.