Codex notifications on Mac, from the notch.
Add a hook snippet to ~/.codex/hooks.json and Codex shows a card from your Mac's notch whenever it wants to run something. Install drip with brew install jrnxf/tap/drip, add the snippet, then run /hooks in Codex to trust it.
brew install jrnxf/tap/drip
Add this to ~/.codex/hooks.json ($CODEX_HOME/hooks.json if you set it). If the file has a hooks entry already, merge the events and keep your own hooks. This is the permission-cards recipe: a card when Codex needs you, and nothing else.
{
"hooks": {
"PermissionRequest": [
{
"hooks": [
{
"type": "command",
"command": "drip hook codex"
}
]
}
],
"PostToolUse": [
{
"hooks": [
{
"type": "command",
"command": "drip hook codex"
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "drip hook codex"
}
]
}
]
}
}
Codex runs a new hook only after you trust it: run /hooks in Codex. If your config.toml has an older notify = ["drip", "hook", "codex"] line, delete it, or each done card shows twice.
drip is a free, open-source macOS CLI that shows scriptable notification cards from the MacBook notch, for builds, deploys and coding agents like Claude Code, Codex and Gemini CLI.
A card when a turn is done
The everything recipe adds a Stop hook. The done card shows Codex's last message and replaces the waiting card of that session in place. Use this file instead of the one above.
{
"hooks": {
"PermissionRequest": [
{
"hooks": [
{
"type": "command",
"command": "drip hook codex"
}
]
}
],
"Stop": [
{
"hooks": [
{
"type": "command",
"command": "drip hook codex"
}
]
}
],
"PostToolUse": [
{
"hooks": [
{
"type": "command",
"command": "drip hook codex"
}
]
}
],
"UserPromptSubmit": [
{
"hooks": [
{
"type": "command",
"command": "drip hook codex"
}
]
}
]
}
}
How it works
- Hooks, not polling. The snippet hooks Codex's
PermissionRequestevent, which fires when Codex wants to run something.PostToolUseandUserPromptSubmitare in it only to take the card away. - One card per request. Each hook runs
drip hook codex, which reads the hook's JSON and showsmy-app needs youwith what Codex wants, such asCodex wants to run npm install. - Gone once you answer. Approve in the terminal, or send Codex a prompt, and the card that said it needs you goes.
- Otherwise it stays until you click it, the session's next card replaces it, or 10 minutes pass. A click brings forward the terminal Codex runs in.
- Codex's own icon. The card shows the icon of the Codex app or ChatGPT.app when one is installed, and the Codex mark that drip bundles when not.
FAQ
Do I need to change Codex's config.toml?
No, the hooks live in ~/.codex/hooks.json. Only if config.toml has an older notify = ["drip", "hook", "codex"] line, delete it, or each done card shows twice.
Why does Codex show no card after I add the hooks?
Codex runs a new hook only once you trust it. Run /hooks in Codex and trust the drip hooks.
Can I get a card when Codex finishes?
Yes. Add a Stop hook that runs drip hook codex, as the everything recipe above does. The done card shows Codex's last message. To skip it for short turns, add --min-turn 30 to that hook, as the long-turns recipe does.
Can I allow or deny from the card?
Yes, with the approve-from-card recipe, which runs drip hook codex --approve on PermissionRequest. Codex asks in its terminal only once the hook returns, so the card has Allow and Deny only while you are not watching that terminal. With nothing clicked in 9 minutes, the terminal asks as usual.
How do I get no cards from one Codex run?
Set DRIP_HOOK=off for that run, as in DRIP_HOOK=off codex exec "fix the flaky test". drip cannot tell a Codex session nobody attends, so the variable is how you say it.
Related
- Claude Code notifications on Mac
- Alert when a terminal command finishes
- Gemini CLI notifications on Mac
- Claude Code permission prompt notification
- opencode notifications on Mac
- Aider notifications on Mac
- A terminal-notifier alternative for scripts
- drip vs terminal-notifier, osascript and alerter
- drip on GitHub