approve-merge

approve-merge is a command for Claude Code from xsovad06/sova. It costs 20 tokens per session (2,220 once invoked), scanned B, original, Apache-2.0.

A command for completing an approved GitHub pull request, which is a proposed code change awaiting integration. It verifies the pull request and then combines it into the main code branch.

In plain words
What is it for?
Use it when a pull request has been approved, its checks have passed, and it is ready to be merged using a single combined commit.
Why use it?
It keeps the final integration step consistent by checking mergeability and automated checks before cleanup. It also removes the completed development branch afterward.

Command for Claude Code

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 commands/xsovad06/sova/approve-merge
Clone the repo
git clone --depth 1 https://github.com/xsovad06/sova

Made for: Claude Code.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for approve-merge

README.md
[![agentmods](https://agentmods.dev/badge/commands/xsovad06/sova/approve-merge.svg)](https://agentmods.dev/commands/xsovad06/sova/approve-merge)
Your own site
<a href="https://agentmods.dev/commands/xsovad06/sova/approve-merge"><img src="https://agentmods.dev/badge/commands/xsovad06/sova/approve-merge.svg" alt="Measured on agentmods" height="20"></a>
Per session 20 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 2,220 The whole file, excluding the scripts and references it only reads on demand.
Security scan B 1 finding. 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.00020 $0.02220
Opus 5 $0.00010 $0.01110
Sonnet 5 $0.00004 $0.00444
Haiku 4.5 $0.00002 $0.00222

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

Security

Grade B, and why

approve-merge scanned grade B with 1 finding 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 4d 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.

Reads agent configuration directoriesmediumAgent snooping

.claude/, .codex/, .gemini/ hold keys, settings and other credentials a mod has no legitimate need for.

cat .claude/agent-control/handoff.json 2>/dev/null
.claude/commands/approve-merge.md · 218 lines

How it starts

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

Approve Merge

Merge a PR and perform post-merge cleanup. This command is the final step in the shipping pipeline -- it runs after the PR has been rebased, CI has passed, and the user has approved the merge from the dashboard.

# Benchmark logging (entry)
bash .claude/benchmark/log.sh "approve_merge_start" "" "" 2>/dev/null || true

PR: $ARGUMENTS

Instructions

You are an autonomous agent handling the merge and cleanup of an approved PR.

1. Read Handoff Context

Check if a handoff file exists from a previous agent:

cat .claude/agent-control/handoff.json 2>/dev/null

If present, extract pr_number, issue, and branch from it. If not present, parse the arguments directly.

2. Pre-Merge Verification

# Verify PR is still approved and mergeable
gh pr view <PR_NUMBER> --json state,reviewDecision,mergeable,statusCheckRollup,headRefName,baseRefName

# Check CI status
gh pr checks <PR_NUMBER>

Verify:

  • PR state is OPEN
  • PR is mergeable (no conflicts)

Note: formal GitHub review approval is NOT required. The user triggering this command from the dashboard is the approval. Log the review status for the record, but proceed regardless.

If CI checks are still pending, poll in a loop. Replace <PR_NUMBER> with the actual PR number from context before executing the loop as a single Bash tool call. Requires gh CLI v2.32+ (for the bucket field).

# Set the PR number once at the top -- substitute from context
PR_NUM=<PR_NUMBER>
# Poll CI checks in a loop (30 iterations x 30s = 15 minutes max)
# Uses `bucket` (not `state`) -- bucket normalizes raw states into: pass, fail, pending, skipping, cancel
# Grace period: first 5 iterations (2.5 min) tolerate TOTAL=0 for checks to register after push
for i in $(seq 1 30); do
  echo "--- CI poll attempt $i/30 ---"
  CHECKS_JSON=$(gh pr checks "$PR_NUM" --json name,bucket 2>/dev/null || echo "[]")
  echo "$CHECKS_JSON" | jq -r '.[] | "\(.bucket)\t\(.name)"'
  STATS=$(echo "$CHECKS_JSON" | jq -r '
    (length | tostring) + "\t" +
    ([.[] | select(.bucket == "pending")] | length | tostring) + "\t" +
    ([.[] | select(.bucket == "fail" or .bucket == "cancel")] | length | tostring)
  ' 2>/dev/null) || { echo "Failed to parse CI check status"; break; }
  IFS=$'\t' read -r TOTAL PENDING FAILED <<< "$STATS"
  if [ "$TOTAL" -eq 0 ]; then
    if [ "$i" -lt 5 ]; then
      echo "No checks registered yet (grace period $i/5)"
      sleep 30
      continue
    else
      echo "NO_CHECKS: no CI checks configured (grace period expired)"
      break
    fi
  fi
  if [ "$PENDING" -eq 0 ]; then
    if [ "$FAILED" -gt 0 ]; then
      echo "CI FAILED: $FAILED check(s) failed"
      break
    else
      echo "CI PASSED: all $TOTAL checks passed"
      break
    fi
  fi
  if [ "$i" -eq 30 ]; then
    echo "CI TIMEOUT: checks still pending after 15 minutes"
    break
  fi
  sleep 30
done

Read the full file on GitHub · 218 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. 4d ago First seen · 218 lines · 20 tokens per session scan B a18ee04fb2d3

Subscribe to this mod's changes

approve-merge is a command published in the GitHub repository xsovad06/sova (2 stars, last pushed yesterday), licensed Apache-2.0. It adds 20 tokens to every session and 2,220 once invoked, about $0.0001 per session on Opus 5. A static security scan graded it B with 1 finding (reads agent configuration directories). No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-31.