Hooks are event-driven automation scripts that execute in response to Claude Code events. Use hooks to validate operations, enforce policies, add context, and integrate external tools into workflows.
Important: The examples below show the hook event structure that goes inside either format. For plugin hooks.json, wrap these in {"hooks": {...}}.
Execute before any tool runs. Use to approve, deny, or modify tool calls.
이 기술은 사용자가 "후크 생성", "PreToolUse/PostToolUse/Stop 후크 추가", "도구 사용 유효성 검사", "프롬프트 기반 후크 구현", "${CLAUDE_PLUGIN_ROOT} 사용", "이벤트 기반 자동화 설정", "위험한 명령 차단"을 요청하거나 후크 이벤트(PreToolUse, PostToolUse, Stop, SubagentStop, SessionStart, SessionEnd, UserPromptSubmit, PreCompact, 알림). 고급 프롬프트 기반 후크 API에 중점을 두고 Claude Code 플러그인 후크 생성 및 구현에 대한 포괄적인 지침을 제공합니다. 출처: galaxy-dawn/claude-scholar.