No slash command · from authoring
Guides creation, debugging, and planning of Claude Code hooks for guardrails, context injection, quality gates, notifications, and automation. Covers lifecycle events, handler types, and decision control.
Ships in authoring. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them.
Hooks are deterministic handlers that fire at lifecycle events. Unlike instructions, hooks cannot be ignored — they block, inject, or modify at the system level.
Hooks fire at three points in execution: before the user or agent acts (UserPromptSubmit, PreToolUse), after the system acts (PostToolUse, Stop), and during agent lifecycle transitions (SubagentStart, TaskCompleted). Session bookend events (SessionStart, SessionEnd) handle setup and teardown. See reference.md for the full event list with blocking/injection capabilities per event.
Pick based on how complex the decision is:
| Handler | Use when... |
|---|---|
| command | Logic is deterministic — regex check, file exists, env var set. Fastest. |
| prompt | Decision requires judgment but no file access — "is this prompt asking for secrets?" |
| agent | Decision requires investigation — read files, run commands, check state. |
| http | Hook logic lives outside the machine — shared enforcement service, cross-team policy. |
Default to command. Escalate to prompt only when a shell script can't encode the judgment. Use agent sparingly — it spawns a subagent and adds real latency.
All hook output must be wrapped in hookSpecificOutput with the matching hookEventName. hookEventName is required — without it, Claude Code silently drops the payload.
{
"hookSpecificOutput": {
"hookEventName": "PreToolUse",
"additionalContext": "injected text"
}
}
See reference.md for the full per-event return value spec (permissionDecision, updatedInput, decision: "block", etc.).
Use | to target multiple tools: "matcher": "Write|Edit|MultiEdit". MCP tools match as mcp__servername__toolname. Omit matcher to catch all tools for that event.
See reference.md for full matcher syntax including SessionStart variants.
Hooks can be declared in SKILL.md or agent frontmatter to scope them to that skill/agent only — useful for guardrails that shouldn't apply globally. Uses the same matcher/handler format as hooks.json, nested under hooks: in frontmatter. See reference.md for a full example.
See patterns.md for comprehensive examples organized by category:
"async": true for hooks that shouldn't block (tests, notifications)stop_hook_active to prevent infinite continuation loops.What SKILL.md sets; muted values are Claude Code's defaults
Three short reads, in order
hooks, guardrails, lifecycle-events, automation, quality-gates
npx claudepluginhub crouton-labs/crouton-kit --plugin authoring16 skills in this plugin
/claude-md-authoringBest practices for writing effective CLAUDE.md files. Use when creating, updating, or auditing CLAUDE.md files for projects or directories./cli-designDesign CLIs for humans and LLM agents — subcommand shape, output streams, exit codes, JSON modes, TTY-aware color, structured errors, mutation safety. Use when building or refactoring a CLI, adding machine-readable output, writing --help, deciding stdout vs stderr, or making a tool agent-friendly./commands-authoringGuide to writing slash commands for Claude Code. Use when creating commands that set mode, constraints, or workflows invoked via /command-name./context-managementToken budgeting, placement effects, RAG patterns, prompt caching, compression, and multi-turn context strategies for LLM applications. Use when dealing with context windows, token budgets, retrieval-augmented generation, long context, context overflow, caching costs, observation masking, or compressing LLM inputs./eval-and-quality-gatesEvaluation strategies and quality gates for LLM systems. LLM-as-judge implementation, prompt regression testing, structural and semantic validation pipelines, production monitoring, guardrails, and metrics that actually work. Use when building evals, setting up CI quality gates, testing prompts, measuring output quality, detecting regressions, or adding safety guardrails to AI applications./multi-agent-orchestrationDesign and implement multi-agent LLM systems. Covers orchestrator patterns, parallel agent coordination, pipeline architecture, hierarchical delegation, agent communication, and failure handling. Use when building multi-agent workflows, coordinating parallel agents, designing orchestrators, splitting tasks across agents, or debugging multi-agent failures.Other plugins' skills for the same job