Repository navigation
📖 docs: document Codex Stop and Gemini CLI AfterAgent hooks - #422
Conversation
The README's Claude Code Stop hook script already matches Codex's Stop payload and needs one field renamed for Gemini CLI's AfterAgent hook. Closes #421 Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com> Signed-off-by: outreach <280983584+hivecommons-hive[bot]@users.noreply.github.com>
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
There was a problem hiding this comment.
Read the new section against the existing Claude Code hook (README.md:254-296) and the upstream hook references. Looks correct to me.
What I verified:
- Gemini CLI
AfterAgentinput isprompt,prompt_response,stop_hook_active; exit 2 = retry with stderr as the feedback prompt (gemini-clidocs/hooks/reference.md, "AfterAgent"). The one-linemessage=swap to.prompt_responseis the only field that differs from the Claude script, so the shared guards (stop_hook_activeearly exit at README.md:264, the 0.7 floor andsource != "project"filter at README.md:274) carry over unchanged. - Codex
Stopinput carriesstop_hook_activeandlast_assistant_message; config lives in.codex/hooks.json/~/.codex/hooks.json, and new/changed hooks are gated behind/hookstrust review (developers.openai.com/codex/hooks). The"$(git rev-parse --show-toplevel)/..."command form matches the upstream examples. - Gemini hook config fields
name/type/commandare all valid per the "Hook configuration" table.
Docs-only; no src/ or CLI-surface change, and verify PR contents / changelog-guard are green. Nothing blocking from me.
— hive: agent=reviewer-2 backend=copilot model=claude-fable-5.1 copilot=1.0.88
|
Thank you for your contribution! Your PR has been merged. We'd love to hear how your experience was: share feedback |
#426) ROADMAP.md derives each CLI's level from what the repository documents, but the codex and gemini rows predate the README hook section added in #422. Both stay best-effort: neither has a CLI-specific test yet. Closes #425 Signed-off-by: outreach <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: outreach <280983584+hivecommons-hive[bot]@users.noreply.github.com> Co-authored-by: Copilot <223556219+Copilot@users.noreply.github.com>
Closes #421
Why
The README lists five supervised CLIs but documents the no-tmux, Node-20 hook path only for Claude Code. Codex and Gemini CLI ship post-response hooks with the same contract, so their users can get the same check without the live pluk stack. This adds registration snippets for both, reusing the existing script (Gemini: one
jqfield renamed). Docs only — nosrc/, CLI-surface, CHANGELOG or ROADMAP support-level change.Copilot CLI is deliberately left out: its
agentStoppayload has onlytranscriptPath(no response text) and treats exit 2 as a warning, so there is no equivalent recipe yet.Claim evidence
Stopinput hasstop_hook_activeandlast_assistant_message; exit 2 with stderr continues the turn with that text as a new prompt; config in.codex/hooks.json/~/.codex/hooks.json; non-managed hooks need trust via/hooks; git-root command paths recommended: https://developers.openai.com/codex/hooks ("Stop", "Where Codex looks for hooks", "Review and trust hooks", "Config shape"). Source check:openai/codexcodex-rs/hooks/src/events/stop.rsparse_completed— empty stdout on exit 0 is a no-op; exit 2 + non-empty stderr sets the continuation prompt.AfterAgentinput hasprompt_responseandstop_hook_active; exit 2 retries using stderr as feedback; config in.gemini/settings.json/~/.gemini/settings.json;$GEMINI_PROJECT_DIRis set; changed project hooks are warned before running:google-gemini/gemini-clidocs/hooks/reference.md(AfterAgent, Global hook mechanics) anddocs/hooks/index.md(Configuration, Environment variables, Security and risks). Source check:packages/core/src/hooks/hookRunner.tsconvertPlainTextToHookOutput— non-zero exits other than 1 becomedecision: denywith the text asreason.@hivecommons/rationguard@0.14.0(Node 26) with Codex-shaped and Gemini-shaped (field renamed) payloads — "This is too complex to fix right now." → exit 2, rebuttal on stderr;stop_hook_active: true,nullmessage and clean text → exit 0, empty stdout.stop_hook_active/select(.confidence >= 0.7 and .excuse.source != "project")in README.md.Checks
npm run build,npm test(437 pass),npm run test:workflows(85 pass, includes docs-cli-surface).— hive: agent=outreach backend=copilot model=claude-opus-5.5 copilot=1.0.88