moai-cc-hooks

Configure Claude Code safety hooks across PreToolUse, PostToolUse, SessionStart, Notification, and Stop events.

1|Updated Jul 28, 2025
One-click install
npx skills add https://github.com/kivo360/quickhooks --skill moai-cc-hooks-kivo360
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: moai-cc-hooks
Source: https://github.com/kivo360/quickhooks/tree/main/.claude/skills/moai-cc-hooks
Command: npx skills add https://github.com/kivo360/quickhooks --skill moai-cc-hooks-kivo360

SYSTEM DOCUMENTATION & REQUIREMENTS

💡 This Skill includes scripts (resource) components.

What problem does it solve?

This Skill documents and standardizes Claude Code hooks to enforce safety checks, auto-formatting, and workflow automation.

Core Features & Use Cases

  • Hook Types: PreToolUse, PostToolUse, SessionStart, Notification, Stop.
  • Automation: Trigger safety gates, linting, and context seeding without blocking work.

Quick Start

Define a basic PreToolUse hook to validate commands before execution.

Frequently Asked Questions about moai-cc-hooks

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I set up safety hooks for Claude Code to validate commands before execution?

Safety hooks in Claude Code use PreToolUse hooks to validate commands before execution. Configure them in settings.json with matcher-based routing, define validation logic, and return exit code 0 to allow or 1 to block execution. PreToolUse hooks execute in under 100ms to avoid workflow delays.

What hook types does Claude Code support for automation and workflow triggering?

Claude Code supports five hook types: PreToolUse (validate before execution), PostToolUse (process results), SessionStart (initialize context), Notification (alert on events), and Stop (cleanup on exit). Each hook type enables different automation scenarios from safety gates to context seeding.

Can I use Claude Code hooks to auto-format and lint code during sessions?

Yes. PostToolUse and SessionStart hooks can trigger auto-formatting and linting workflows without blocking work. Configure command execution guards in settings.json and use matcher-based routing to apply formatting and linting rules selectively across your session.

How do I configure Claude Code hooks with JSON settings for matcher-based routing?

Claude Code hooks use JSON-based settings.json configuration with matcher-based routing to direct hook behavior. Define matchers to target specific commands or contexts, assign hook handlers, and specify exit codes (0 for success, 1 for block, 2 for error). Logging guidelines ensure visibility into hook execution.

What are the performance requirements for Claude Code hooks?

PreToolUse hooks must execute in under 100ms to maintain responsiveness. SessionStart hooks have a 500ms limit. These constraints ensure hooks enforce safety and automation without slowing down Claude Code workflows or creating noticeable delays.

Do Claude Code hooks require dependencies or special setup beyond settings.json configuration?

Claude Code hooks have no external dependencies. Setup requires only JSON-based settings.json configuration and script components. Exit code semantics (0/1/2) and comprehensive logging provide robust hook behavior without additional tools or prerequisites.