merge-gate

Reviewed at commit e839261 New version, not yet reviewed

Holds `gh pr merge` until CI passes and one Codex review (OpenAI's luna model) has run. A PR line above the prompt, and /gate shows the PR's status.

Made by
Hamza Zafar
What we checked

Watches the Bash commands Claude runs. It holds `gh pr merge` until the PR's CI is green and one Codex review has run, asking you whether to merge anyway. It also allows only one `codex review` per PR, refuses `codex exec`, and shows a PR status line above the prompt. It runs `gh` and `git` for status and keeps review counters locally.

Review details

Static review of the source at the pinned commit; not run. Delta review of the changes since 0ca6b2a; the rest carries over from the review at that commit. The change adds a shared hooks/bands.ts: the band is now wrapped in a keyed Box and sorted with other band mods by an optional order file, <CLAUDE_CONFIG_DIR or ~/.claude>/claude-code-mods/bands.json, read once per session with $.env.get (CLAUDE_CONFIG_DIR, HOME) and $.fs.exists/$.fs.read and parsed as JSON inside a try/catch (a list of mod names, [] on any error). The file is only read, never written, and its content is only used to sort. Registers session.start (registers /gate), turn.complete (background status refresh), tool.call for Bash, command.run for gate, and ui.render for AbovePrompt. The Bash handler parses the command (quoted text, heredocs and comments stripped) and denies `codex exec`, denies `codex review` unless the gpt-5.6-luna model is given, the Codex config does not point at Ollama and no review was counted for the PR yet, and for `gh pr merge` checks CI and the Codex counter and asks via $.ui.ask (Hold or Merge anyway; no answer means hold). Everything else passes through unchanged. It reads ~/.codex/config.toml with $.fs.read, only to test for an Ollama base URL or model, and does not edit it. It runs gh pr view, gh pr checks, git rev-parse and git branch with timeouts, and /gate rerun runs `gh run rerun --failed` on failed runs of the current branch only when the user types it. Counters are kept with $.store. No network calls of its own, no model calls, failures are swallowed or fall back to holding the merge. The Codex review itself is run by Claude through the user's own codex CLI; this mod does not send anything. The tool.call logic is unchanged in this version.

What it uses
  • Reads your prompts: no
  • Sees tool calls: yes
  • Blocks or changes tool calls: yes
  • Reads or writes files: yes
  • Runs programs on your machine: yes
  • Calls the model (uses tokens): no
  • Sends data over the network: no
  • Stores data: yes
  • Shows something on screen: yes
Hooked events
Screenshot of merge-gate
Made this mod? Add a badge to your README

modsforClaude badge for merge-gate

Paste this into your README. The badge says reviewed once the current version has been reviewed, and links readers to this page.

[![Listed on modsforClaude](https://modsforclaude.com/badge/merge-gate.svg)](https://modsforclaude.com/mods/merge-gate/)

← All mods