> ## Documentation Index
> Fetch the complete documentation index at: https://exosphere-auto-translate-docs-20260623-1106.mintlify.site/llms.txt
> Use this file to discover all available pages before exploring further.

# Hook 핸들러 (내부)

> 각 도구 이벤트마다 Claude Code가 호출하는 서브프로세스

```bash theme={null}
failproofai --hook <EventType>
```

이 명령어는 `failproofai policies --install`에 의해 Claude Code의 `settings.json`에 등록됩니다. 일반적으로 직접 호출할 필요는 없습니다.

stdin에서 JSON 페이로드를 읽고, 활성화된 모든 정책을 평가한 뒤, 결정 결과를 나타내는 종료 코드와 함께 종료합니다:

| 종료 코드 | 결정         | 효과                               |
| ----- | ---------- | -------------------------------- |
| `0`   | `allow`    | 작업을 허용합니다                        |
| `1`   | `deny`     | 작업을 차단합니다 - Claude가 거부 이유를 확인합니다 |
| `2`   | `instruct` | Claude의 컨텍스트에 가이던스를 주입합니다        |

### 지원되는 이벤트 유형

| 카테고리             | 이벤트                                                                                        |
| ---------------- | ------------------------------------------------------------------------------------------ |
| **도구 실행**        | `PreToolUse`, `PostToolUse`, `PostToolUseFailure`, `PermissionRequest`, `PermissionDenied` |
| **세션 라이프사이클**    | `SessionStart`, `SessionEnd`, `Stop`, `StopFailure`                                        |
| **사용자 인터랙션**     | `UserPromptSubmit`, `Notification`, `Elicitation`, `ElicitationResult`                     |
| **서브에이전트 및 태스크** | `SubagentStart`, `SubagentStop`, `TaskCreated`, `TaskCompleted`, `TeammateIdle`            |
| **구성**           | `InstructionsLoaded`, `ConfigChange`, `CwdChanged`                                         |
| **파일 시스템**       | `FileChanged`, `WorktreeCreate`, `WorktreeRemove`                                          |
| **컨텍스트**         | `PreCompact`, `PostCompact`                                                                |
