Skip to content

Codex CLI phone notifications (mirror the Claude hook) - #14

Merged
oz6un merged 1 commit into
mainfrom
feat/codex-notifications
Aug 11, 2026
Merged

Codex CLI phone notifications (mirror the Claude hook)#14
oz6un merged 1 commit into
mainfrom
feat/codex-notifications

Conversation

@oz6un

@oz6un oz6un commented Aug 11, 2026

Copy link
Copy Markdown
Owner

Why

Codex should ping the phone like Claude Code does, so an agent working on the box reaches you when it hands control back.

What

A codex-notify hook mirroring claude-notify, gated behind INSTALL_CODEX:

  • Codex's notify mechanism differs from Claude's hooks — it fires only agent-turn-complete, passes the event JSON as an argv argument (not stdin), and has no idle/error/needs-input event to filter on. So the hook pushes on turn-complete, which is Codex's genuine "over to you" moment (it doesn't produce Claude's intermediate-stop flood). Same Pushover pipe, same presence-suppression while you're active in tmux.
  • Wired via ~/.codex/config.toml's root notify key. Per TOML, root keys must precede tables, so remote-setup.sh prepends it (idempotent) and creates the file if absent.
  • setup-user.sh renders the template; install + config wiring happen only in the INSTALL_CODEX block.

Verified

Proven end-to-end on the box: a real codex exec invoked the hook with its actual payload ({"type":"agent-turn-complete","cwd":"…","last-assistant-message":"…"}) as argv — which also confirmed a cwd field, now used for the project name. Event matrix (stubbed, no phone spam): agent-turn-complete → push; other types / empty → silent. One real Pushover delivery confirmed. make check green; box hook == rendered repo template; config.toml notify sits at line 1, ahead of all tables.

🤖 Generated with Claude Code

Codex's notify differs from Claude's hooks: it fires only agent-turn-complete,
passes the event JSON as argv (not stdin), and exposes no idle/error event to
filter on — so codex-notify pushes on turn-complete (Codex's genuine hand-back
moment; no intermediate-stop flood), same Pushover pipe + tmux presence
suppression. Wired via config.toml's root notify key (prepended, since TOML
root keys must precede tables). Gated behind INSTALL_CODEX. Proven end-to-end:
a real codex exec invoked the hook with its actual payload.

Co-Authored-By: Claude Fable 5 <noreply@anthropic.com>
@oz6un
oz6un merged commit 0f6900c into main Aug 11, 2026
1 check passed
@oz6un
oz6un deleted the feat/codex-notifications branch August 11, 2026 12:14
oz6un added a commit that referenced this pull request Aug 20, 2026
…#16)

Adds an opt-in INSTALL_KIMI=1 that installs Moonshot's Kimi Code CLI
alongside Claude Code and Codex, wired to the same presence-aware Pushover
pipe — mirroring the Codex work (#14).

- files/kimi-notify.tmpl: Pushover hook. Fires on Stop (turn hand-back —
  the genuine "over to you"; Kimi has no idle event and Stop fires once per
  hand-back, confirmed from a captured payload) and StopFailure. Backgrounds
  the curl (setsid) because Kimi's [[hooks]] has no async flag.
- remote-setup.sh: installs from the GLOBAL mirror (code.kimi.ai => region
  "global"; .com is mainland-CN and mis-targets login) with
  KIMI_NO_MODIFY_PATH=1, then injects Stop/StopFailure [[hooks]] into
  ~/.kimi-code/config.toml idempotently (appends — never overwrites, which
  would drop default_model/providers). config.toml is written by `kimi login`,
  so injection is post-auth; re-run `make setup` after login.
- config.fish owns the ~/.kimi-code/bin PATH entry (added only when present).
- setup-user.sh renders the notifier; secrets.env.example gains INSTALL_KIMI.
- README + FOOTGUNS: device-code `kimi login`, the region trap, config.toml
  ownership, and a disk-full note (the box hit 100%, no health alerting).

Verified live: install + `kimi login` (device flow) + a real Stop hook →
Pushover status:1, and `make setup` converges idempotently.

Co-authored-by: Claude Opus 4.8 <noreply@anthropic.com>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant