> ## Documentation Index
> Fetch the complete documentation index at: https://midway.hazyio.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Codex CLI

> Send Midway notifications from Codex CLI hooks

Add hooks to `.codex/hooks.json` in a trusted project or `~/.codex/hooks.json`. `Stop` notifies when a turn finishes. `PermissionRequest` notifies when Codex is waiting for approval to use a tool; it does not cover other clarification requests.

```json theme={null}
{
  "hooks": {
    "Stop": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "midway send-text -m \"Codex finished\""
          }
        ]
      }
    ],
    "PermissionRequest": [
      {
        "hooks": [
          {
            "type": "command",
            "command": "midway send-text -m \"Codex needs approval\""
          }
        ]
      }
    ]
  }
}
```

Codex requires you to review and trust a new or changed hook before it runs. Use `/hooks` in Codex to review it.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.