manage-hooks
БесплатноБез исполняемых скриптовНе проверенThis skill should be used when the user asks to "create a hook", "add a PreToolUse hook", "debug a hook", "fix a hook", "hook not working", or mentions hook…
Об этом скилле
1. Three Hook Types:
- command — shell command, deterministic, fast. Exit 0 = proceed, exit 2 = block. JSON stdout for structured control.
- prompt — single-turn LLM evaluation (Haiku default). Returns
{"ok": true}or{"ok": false, "reason": "..."}. - agent — multi-turn subagent with tool access (up to 50 turns). Same ok/reason output. Use when verification needs codebase access.
2. Event → Matcher → Hook — Events (PreToolUse, Stop, etc.) trigger matchers (regex on tool name/context) which fire hooks. See <quick_reference> for the full event table.
3. Configuration Locations (highest priority first):
- User-global:
~/.claude/settings.json - Project shared:
.claude/settings.json - Project local:
.claude/settings.local.json - Or use
/hooksinteractive menu in Claude Code
4. Environment Variables:
| Variable | Value |
|---|---|
$CLAUDE_PROJECT_DIR |
Project root directory |
${CLAUDE_PLUGIN_ROOT} |
Plugin directory (plugin hooks only) |
$ARGUMENTS |
Hook input JSON (prompt/agent hooks only) |
$CLAUDE_ENV_FILE |
Path for persisting environment variables |
5. Safety Essentials:
- Stop hook loops: Always check
stop_hook_activefield in Stop/SubagentStop hooks — exit 0 if true - Timeouts: Set reasonable values in seconds (default: 10 min commands, 60s agents, 30s prompts)
- Permissions:
chmod +xon script files - Path safety: Quote
"$CLAUDE_PROJECT_DIR"for spaces - Shell profiles: Wrap echo in
~/.zshrc/~/.bashrcwith$- == *i*checks — non-interactive shells can corrupt JSON output - PermissionRequest: Doesn't fire in headless mode (
-p); use PreToolUse instead
- Create a new hook
- Debug / fix a hook
- Create a toolkit hook (distributable)
- Get guidance on hook design
If $ARGUMENTS provides clear intent, skip the menu and route directly.
Intent-based routing (when $ARGUMENTS provides clear intent):
- "block dangerous commands" → workflows/create-hook.md
- "my hook isn't triggering" → workflows/debug-hook.md
- "package for toolkit" → workflows/create-toolkit-hook.md
- "what event should I use" → workflows/get-guidance.md
After reading the workflow, follow it exactly.
See references/hook-types.md for detailed schemas and use cases for each event.
Types & Events: hook-types.md — complete event schemas and use cases Hook Types: command-vs-prompt.md — decision tree for command vs prompt vs agent Matchers: matchers.md — regex patterns, event-specific matching, MCP tools I/O Schemas: input-output-schemas.md — stdin JSON, exit codes, hookSpecificOutput **Exam
Установить manage-hooks в Claude Code и Claude Desktop
Зарегайся, чтобы установить скилл
Создай бесплатный аккаунт, чтобы открыть команду установки и сохранить скилл в библиотеку.
- Открой команду установки в одну строку
- Сохраняй скиллы в синхронизируемую библиотеку
- Уведомления, когда скиллы обновляются
Разрешённые инструменты
Инструменты, которые скиллу разрешено вызывать.
ReadWriteEditBashGlobGrepВложенные файлы
FAQ
Что делает скилл manage-hooks?
This skill should be used when the user asks to "create a hook", "add a PreToolUse hook", "debug a hook", "fix a hook", "hook not working", or mentions hook configuration, hook events, hook types, automating workflows, or understanding hooks. Provides expert guidance for creating, configuring, debugging, and managing Claude Code hooks.
Как установить скилл manage-hooks?
Скопируй папку скилла в ~/.claude/skills (вкладка Claude Code выше делает это одной командой), либо поставь как плагин.
Скилл manage-hooks запускает скрипты?
Нет, скилл состоит только из инструкций (SKILL.md), без исполняемых скриптов.
Похожие скиллы
mcp-builder
Guide for creating high-quality MCP (Model Context Protocol) servers that enable LLMs to interact with external services through well-designed tools. Use when…
от Anthropicclaude-api
Reference for the Claude API / Anthropic SDK — model ids, pricing, params, streaming, tool use, MCP, agents, caching, token counting, model migration. TRIGGER…
от Anthropicalgorithmic-art
Creating algorithmic art using p5.js with seeded randomness and interactive parameter exploration. Use this when users request creating art using code…
от Anthropicmcp-integration
This skill should be used when the user asks to "add MCP server", "integrate MCP", "configure MCP in plugin", "use .mcp.json", "set up Model Context…
от Anthropic