# Codex Integration

## Setup

1. Copy `hooks.example.json` to Codex hooks location:
   ```bash
   mkdir -p .codex
   cp codex/hooks.example.json .codex/hooks.json
   ```

2. Ensure hook scripts are executable:
   ```bash
   chmod +x codex/hooks/*.js
   ```

3. Start Codex in the repository

4. Run `/hooks` in Codex to review and trust the hooks

## Trust Flow

Codex requires non-managed hooks to be reviewed and trusted before execution:
- Run `/hooks` in Codex
- Review each hook script
- Trust the hooks for execution

## Trigger Events

After trusting hooks:
- **SessionStart** triggers on session start
- **UserPromptSubmit** triggers when you submit a prompt
- **PreToolUse** triggers before any tool execution
- **PostToolUse** triggers after tool execution completes
- **Stop** triggers when Codex completes its response

## Verify

After using Codex:
```bash
npm run summary
```

Expected: Codex events logged in the summary.