Repository navigation
Description
Scoped from #406's Gemini arm after installing the binary rather than reasoning from docs, the same way the Codex arm was settled. Everything below is observed against gemini 0.57.0 on macOS 15.3.2 arm64 unless labelled otherwise.
What the install itself teaches
Install from npm, not Homebrew. The gemini-cli formula is 0.46.0, marked "Deprecated because it is not supported upstream", disabled 2026-12-18, and points at antigravity-cli — a different product. Upstream is alive and eleven minor versions ahead: @google/gemini-cli is 0.57.0 latest with a nightly cut the same day. Anyone documenting an install route should write the npm one.
The event mapping does not need designing — Gemini generates it
gemini hooks migrate --from-claude exists and is a first-class subcommand (gemini hooks migrate, "Migrate hooks from Claude Code to Gemini CLI"). Fed this repository's actual hooks/hooks.json as a Claude settings file, it produced a complete .gemini/settings.json:
| Ours | Gemini's |
|---|---|
SessionStart |
SessionStart |
SessionEnd |
SessionEnd |
UserPromptSubmit |
BeforeAgent |
PostToolUse |
AfterTool |
It also emits empty arrays for the events we bind nothing to: BeforeTool, AfterAgent, Notification, PreCompress, BeforeModel, AfterModel, BeforeToolSelection.
So the translation layer this arm looked like it needed is upstream's, not ours. What we owe is a checked-in manifest, not a mapping.
The migration output would not work, and the reason is already fixed elsewhere
The generated file carries our command strings verbatim:
"command": "bash \"${CLAUDE_PLUGIN_ROOT}/scripts/session-start-hook.sh\""CLAUDE_PLUGIN_ROOT is a variable Gemini does not set. The migration is a rename of event keys, not a port of the command bodies — reasonable of it, and fatal if the output is used unedited.
#407 already landed the answer: scripts/resolve-paths.sh reads ${PLUGIN_ROOT:-${CLAUDE_PLUGIN_ROOT:-}}, vendor-neutral name first, and tests/test_host_shell_parity_407.py pins the shell list against pipeline/host.PLUGIN_ROOT_VARS. A Gemini manifest should spell it ${PLUGIN_ROOT} — assuming Gemini expands that in a hook command at all, which is not yet observed.
Extension packaging
gemini extensions new <path> scaffolds, and the manifest is minimal:
{ "name": "gemtest", "version": "1.0.0" }gemini extensions link <path> installs from a local path with edits reflected live, and gemini extensions validate <path> checks one — between them a development loop exists that does not need a marketplace, which is a better position than the Codex arm started from.
Open, and not guessable: whether a gemini-extension.json can carry hooks the way .codex-plugin/plugin.json bundles hooks/hooks.json, or whether hooks only ever live in .gemini/settings.json at project or user scope. That decides whether this ships as an installable extension or as documentation telling a user to run the migration themselves. Answer it before writing the manifest.
What is already Gemini-shaped and needs nothing
Three landed fixes name Gemini in their own reasoning and should carry over untouched — #407 (PLUGIN_ROOT over CLAUDE_PLUGIN_ROOT), #411 and #444 (the stdin cwd fallback on all four hooks, because Gemini documents no hook environment variables at all). pipeline/host.py already declares GEMINI = Host(name="gemini-cli").
What is unknown, and what the Codex arm predicts about it
The Codex arm's premise held and still produced four defects nobody predicted (#443, #444, #451, plus the harness one in #454). Expect the same ratio here. Named unknowns, all reachable with the binary now installed:
- Transcript envelope.
pipeline/host.sniff_envelope()knowsclaude-codeandcodex. A Gemini transcript would returnunrecognised— which since extract.py cannot read a Codex rollout transcript, so a Codex session silently saves zero memory #443 reports loudly instead of saving zero silently, so this fails visibly rather than quietly. Where Gemini writes its session record, and in what shape, is unobserved. - Stdout contract. Codex reports UserPromptSubmit as Failed once the hook actually produces output, because its stdout contract is not Claude Code's #451 found Codex sniffs the first non-whitespace byte of
UserPromptSubmitstdout and marks a[-leading prompt stamp asFailed. That fix wraps output on any host withCLAUDE_PROJECT_DIRunset, which includes Gemini — so our current behaviour onBeforeAgentis reasoned, never tested.scripts/user-prompt-hook.shsays so in a comment at the call site. - Whether hooks fire at all, and what their stdin payload carries. Add official OpenAI Codex support #406's premise is a shared
{session_id, transcript_path, cwd, hook_event_name}shape across all three hosts. Codex confirmed it. Gemini has not been asked.
What would settle it
Install (done), then the same loop that worked for Codex: link a local extension, run one real session, read .remember/logs/memory-*.log, and believe the log over the docs. Each thing it breaks on becomes its own issue rather than being folded in here.
Part of #406.
Activity
Add a checked-in Gemini CLI hook manifest (#456) (#531)
Gemini CLI: fix ${PLUGIN_ROOT} in settings.json, add a distributable …
Fix Gemini CLI CLAUDE_PROJECT_DIR assumption across shell layer and R…
Drop the Gemini CLI badge: badge only the observed hosts (#547)
Add Claude Code and Codex host badges to the README (#547) (#548)
Gemini CLI (Digital-Process-Tools#456): resolve two of four open ques…