admin-merge

A command for merging a pull request when branch protection is the only remaining blocker. Branch protection is a repository rule requiring checks or approvals before merging.

In plain words
What is it for?
Use it for a solo-owner pull request after its merge requirements are verified, either to perform an allowed administrative merge or print the protection-toggle command for the repository administrator.
Why use it?
It handles the restricted merge case while keeping branch-protection changes separate from the merge itself.

Skill for Claude CodeCodex

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add skills/auerbachb/claude-code-config/admin-merge
Any agent
npx skills add auerbachb/claude-code-config --skill admin-merge
Clone the repo
git clone --depth 1 https://github.com/auerbachb/claude-code-config

Made for: Claude Code, Codex.

Per session 94 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 3,807 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. Scan, not verified.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5 $0.00094 $0.03807
Opus 5 $0.00047 $0.01903
Sonnet 5 $0.00019 $0.00761
Haiku 4.5 $0.00009 $0.00381

Measured 2d ago against content hash 887bbcff8d8b, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

admin-merge scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 2d ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/skills/admin-merge/SKILL.md · 159 lines

How it starts

The opening of the file, as written. The whole thing — 159 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Merge a PR whose only remaining blocker is branch protection on a solo-owner repo — either by auto-running the no-protection-change shape, or by printing the protection-toggle command for the user.

Portable helper resolution

Before any step, resolve the required helper. Stop visibly if it is unavailable.

resolve_script() {
  local name="$1" candidate
  for candidate in \
    "$HOME/.claude/skills-worktree/.claude/scripts/$name" \
    "$HOME/.claude/scripts/$name" \
    ".claude/scripts/$name"; do
    if [[ -x "$candidate" ]]; then echo "$candidate"; return 0; fi
  done
  return 1
}
ADMIN_MERGE_SH=$(resolve_script admin-merge.sh || true)
[[ -n "$ADMIN_MERGE_SH" ]] || { echo "ERROR: admin-merge.sh not found (checked all three paths) — admin merge unavailable" >&2; exit 1; }

The safety boundary (non-negotiable) — a split, not a blanket

Claude's safety rules permanently prohibit Claude from modifying branch protection — non-negotiable, applies to every user and repo regardless of authorization or workflow history. That prohibition is about protection modification, not about the --admin flag, and the two bypass shapes fall on opposite sides of it (issues #720, #754):

Shape Condition Command Authority
plain enforce_admins: false + required_status_checks.strict: true + verified clean-BEHIND gh pr merge --squash --admin — nothing else Claude auto-runs it via --auto-plain
toggle enforce_admins: true DELETE …/enforce_admins → merge → POST …/enforce_admins Print-only. The user runs it.
  • Claude MAY execute the plain shape via "$ADMIN_MERGE_SH" <PR> --auto-plain. It modifies no setting and steps over a staleness requirement, not a review; every safety condition is re-verified programmatically immediately before the merge. No user turn is required.
  • Claude NEVER executes gh api -X DELETE .../protection/enforce_admins, gh api -X POST .../protection/..., or any other protection-modification command — not directly, not via a subprocess, not via --execute. For the toggle shape Claude only ever prints (or clipboards) the command.
  • The skill invokes admin-merge.sh with --auto-plain, --print, or --launch-terminal. It must never invoke --execute (that mode can run the toggle dance and is reserved for the user in their own terminal).
  • --auto-plain is structurally incapable of the toggle shape: its branch contains no protection-modifying call, and any non-plain shape is a hard refusal (exit 8) that falls back to printing. Mechanism: .claude/reference/admin-merge-auto-plain.md.

Read the full file on GitHub · 159 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 2d ago First seen · 159 lines · 94 tokens per session scan A 887bbcff8d8b

Subscribe to this mod's changes

admin-merge is a skill published in the GitHub repository auerbachb/claude-code-config (5 stars, last pushed 3d ago), licensed MIT. It adds 94 tokens to every session and 3,807 once invoked, about $0.0005 per session on Opus 5. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.