Skip to content

Support Codex hook registration#7

Open
urugus wants to merge 1 commit intoishefi:mainfrom
urugus:fix/codex-hook-registration
Open

Support Codex hook registration#7
urugus wants to merge 1 commit intoishefi:mainfrom
urugus:fix/codex-hook-registration

Conversation

@urugus
Copy link
Copy Markdown

@urugus urugus commented Apr 27, 2026

Bug

Codex CLI hook registration needs a different config file and event set than Claude Code. The current hook installer only writes Claude Code hooks, while Codex users need entries in ~/.codex/hooks.json.

Codex stable also does not support async hooks yet. If Codex hooks are registered with "async": true, Codex prints:

skipping async hook in ~/.codex/hooks.json: async hooks are not supported yet

and skips the hook.

Fix

Register zellaude hooks for both agents when their config directories exist:

  • Claude Code: ~/.claude/settings.json
  • Codex CLI: ~/.codex/hooks.json

The hook command now receives an agent argument (claude or codex) so the plugin can distinguish sessions and render Codex with distinct symbols. Claude hook entries keep "async": true; Codex hook entries omit it until Codex supports async hooks.

The cleanup logic also removes older no-argument Claude hook entries to avoid duplicates during upgrades.

Verification

  • cargo fmt --check
  • git diff --check
  • cargo check --target aarch64-apple-darwin
  • Temp HOME hook install smoke test:
    • Claude entry is installed as zellaude-hook.sh claude with "async": true
    • Codex entry is installed as zellaude-hook.sh codex without "async"
    • Older no-argument Claude hook entries are removed
  • cargo build --release --target wasm32-wasip1 could not complete in this local environment because the active Homebrew Rust toolchain could not find the wasm32-wasip1 core crate, even after rustup target add wasm32-wasip1 reported the target as installed.

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