Skip to content

Hooks

MeowKit uses lifecycle hooks to enforce discipline at the tool level. Some hooks are registered in .claude/settings.json (automatic), others are invoked by skills.

Registered hooks (automatic)

These run automatically via Claude Code's hook system:

HookTypeTriggerWhat it doesBlocks?
post-write.shPostToolUseEdit, WriteSecurity scan: secrets, any type, SQL injection, XSS, destructive patternsYes (exit 2)
post-session.shStopSession endCapture session data to .claude/memory/No

Skill-embedded hooks

These are registered in SKILL.md frontmatter and run when those skills are active:

HookSkillTriggerWhat it does
check-freeze.shmeow:freezeEdit, WriteBlock edits outside frozen directory
check-careful.shmeow:carefulBashWarn on destructive commands (rm -rf, DROP TABLE)

Skill-invoked scripts

These run when specific skills call them:

ScriptPhaseWhat it doesBlocks?
pre-task-check.shAnyPrompt injection pattern detectionYes (BLOCK on injection)
pre-implement.shPhase 2-3TDD gate — blocks without failing testYes
pre-ship.shPhase 5Test + lint + typecheckYes
cost-meter.shAnyToken usage trackingNo

Hook configuration

Hooks are registered in .claude/settings.json:

json
{
  "hooks": {
    "PostToolUse": [
      {
        "matcher": "Edit|Write",
        "hooks": [{ "type": "command", "command": "sh .claude/hooks/post-write.sh \"$TOOL_INPUT_FILE_PATH\"" }]
      }
    ],
    "Stop": [
      { "hooks": [{ "type": "command", "command": "sh .claude/hooks/post-session.sh" }] }
    ]
  }
}

Released under the MIT License.