Skip to content

/massu-scaffold-hook

Scaffold a new Claude Code hook with profile gating and settings.json registration


/massu-scaffold-hook

Creates a complete Claude Code hook following the 3-tier profile system (minimal, standard, strict). Generates the hook script and registers it in .claude/settings.json under the appropriate lifecycle event.

When to Use

  • Adding a new hook: When you need a new PreToolUse, PostToolUse, or SessionStart hook
  • Profile-gated behavior: When the hook should only run under certain profiles
  • Consistent hook structure: Ensures all hooks follow the same patterns

What It Does

  • Creates the hook script in scripts/hooks/[hook-name].sh
  • Registers the hook in .claude/settings.json under the correct lifecycle event
  • Sets up profile gating (minimal/standard/strict)
  • Follows the stdin JSON / stdout JSON I/O pattern

Usage

/massu-scaffold-hook

You will be prompted for the hook name, lifecycle event, and profile level.

Hook Lifecycle Events

EventFires WhenCommon Uses
PreToolUseBefore a tool runsBlocking destructive ops, validation
PostToolUseAfter a tool runsAuditing, pattern scanning, metrics
SessionStartSession starts/resumesContext injection, state loading