ClaudeCodeMod

All shelves / Mods / Safety

merge-gate

By hamzafer

merge-gate is a Claude Code safety mod by hamzafer.

Holds gh pr merge until CI is green and a Codex review has run once, and draws that pull request's status above the prompt.

DrawsHolds a command

Install

The marketplace name is claude-code-mods.

In your shell
claude plugin marketplace add hamzafer/claude-code-mods
claude plugin install merge-gate@claude-code-mods
Open the repo

It runs inside the Claude Code process. The side panel is only what the author's README names. Read the repo before you install, or run claude plugin validate on the plugin folder.

Version
0.1.5
License
MIT
Repo stars
381
Last change
2026-10-15

What it can reach

  • Draws in the session
  • Holds a command
  • Calls another program on this machine

Claude Code 2.1.287 or later. The author says to restart after installing. Needs gh and the Codex CLI. It holds gh pr merge until CI is green and Codex has reviewed the pull request once; if either is missing it asks you, Hold or Merge anyway, and with no one to answer it holds. It refuses a codex review that does not set the author's fixed model, gpt-5.6-luna, so change it in hooks/register.tsx to yours. It also refuses a second review of the same pull request, any codex exec, and any review while ~/.codex/config.toml points at a local Ollama server. A review counts when it starts, so a quota error does not buy a retry. The pull request is the one checked out where the review runs, or its branch before it has one. The line above the prompt shows that pull request's CI checks and Codex review count, /gate shows it, and /gate rerun reruns the failed CI jobs.

The marketplace, claude-code-mods, holds all of hamzafer's mods, rulebook-guard and glance among them. This one installs on its own, or from the checklist that npx claude-code-mods@latest opens. The author lists this with the mods built around their own tools and rules, to fork and change to yours. Stopping a merge before CI and a review pass is why this page files it under safety. ci-watch, by arasovic, draws a progress bar above the prompt for each GitHub Actions run after Claude pushes, then pass or fail. cc-pr-tracker, by sezaakgun, draws each watched pull request with its merge state, review, and required checks. This one holds the merge itself until both are done. The author says its model, second-review, and codex exec checks look only at commands the shell would run, including bash -c and eval, and ignore quoted arguments, heredocs, grep patterns, and comments that only mention one.

Demo

The merge-gate section on the author's GitHub page
Screenshot of the author's GitHub page.

What it hooks into

  • session.startWhen a session starts
  • turn.completeWhen a turn ends
  • tool.callAround a tool call, where it can hold oneBash
  • command.runWhen you run its slash command/gate
  • ui.renderDraws into the sessionAbovePrompt

Read from the on() calls in its hook modules. Open its source under Files to check what each one does.

Slash commands 1

  • /gateShow the PR's CI, Codex review and merge status; /gate rerun retries failed CI

Files

The author's source, 3 files. They load when you open them.

Facts

Author
hamzafer
Category
Safety
Marketplace
claude-code-mods
Repo
hamzafer/claude-code-mods
Folder
mods/merge-gate
Version
0.1.5
License
MIT
Repo stars
381
Last change
2026-10-15
Language
TypeScript
Files
7

Other mods in Safety

rulebook-guardhamzaferHolds a commandAsks before git commit --amend, an unformatted push, or personal details in notes and commits.bash-guardSingh-APHolds a commandHolds every Bash call, even in bypass mode. Blocks rm -rf on a home or system directory, and asks before a force-push, a hard reset, or a pipe into sh.net-guardSingh-APHolds a commandHolds curl, wget, ssh, scp, git push, and WebFetch, even in bypass mode. Blocks paste sites and request catchers, and asks before data goes anywhere new.file-guardSingh-APHolds a commandHolds writes outside the project and writes into .git, and asks before lockfiles and CI files.slopsquat-guardSingh-APHolds a commandHolds a package install and checks the name against its registry, so a hallucinated or typosquatted package does not install.command-explainerSingh-APDraws a plain-English line and a risk level on the permission prompt, so you can see what the command does before you approve it.secret-guardarasovicHolds a commandHides API keys and private keys before the model or the transcript sees them, blocks credential files and commands that print secrets, and shows what it caught.guardrailsarasovicHolds a commandHolds Cloudflare write commands, attribution lines in commits and pull requests, and branch names that start with claude/.guardrails-liteedtrackaiHolds a commandHolds a read of a secret .env file, a git force-push, and a recursive rm on /, ~, or $HOME. .env.example, .env.sample, and .env.template are allowed.injection-guardSingh-APStrips hidden characters from tool output and marks results that carry instructions aimed at Claude, so they reach it as untrusted data.collision-guardnateherkaiHolds a commandHolds an edit to a file another open chat changed in the last 30 minutes, and asks you to proceed, move this chat to a worktree, or cancel.recording-modenateherkaiHolds a commandMasks keys, personal details, and business figures on screen while you record, hides results from mail, chat, and finance tools, and keeps private files closed.
All 73 in Safety