merge

merge is a skill for Claude Code from panayiotism/claude-harness. It costs 42 tokens per session (843 once invoked), scanned A, original, MIT.

A repository-cleanup workflow for GitHub pull requests, which are proposed code changes awaiting review. It also handles linked issues, feature branches, and local or remote Git references.

In plain words
What is it for?
Use it to finish features, merge open pull requests after review, close linked feature or bug-fix issues, and clean up branches and references.
Why use it?
It removes the repetitive work of merging completed changes, closing related work items, and deleting branches in the correct dependency order.

Skill for Claude Code

Written for Claude Code: allowed-tools in frontmatter.

Part of the claude-harness plugin — 6 skills, 1 agent, 8 hooks shipped together

Good fit Use it to finish features, merge open pull requests after review, close linked feature or bug-fix issues, and clean up branches and references.

Compare 6 skills from other repositories ↓
Install with agentmods
npx agentmods add skills/panayiotism/claude-harness/merge
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.

Any agent
npx skills add panayiotism/claude-harness --skill merge
Clone the repo
git clone --depth 1 https://github.com/panayiotism/claude-harness

Made for: Claude Code.

Or install claude-harness, the plugin that ships this one along with the rest of its 6 skills, 1 agent, 8 hooks.

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 merge

README.md
[![agentmods](https://agentmods.dev/badge/skills/panayiotism/claude-harness/merge/github.svg)](https://agentmods.dev/skills/panayiotism/claude-harness/merge)
Your own site
<a href="https://agentmods.dev/skills/panayiotism/claude-harness/merge"><img src="https://agentmods.dev/badge/skills/panayiotism/claude-harness/merge/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for merge

Your own site · 80×15
<a href="https://agentmods.dev/skills/panayiotism/claude-harness/merge"><img src="https://agentmods.dev/badge/skills/panayiotism/claude-harness/merge.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 42 Skills are progressive disclosure: only the name and description are preloaded; the body loads when the skill is used.
When invoked 843 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
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.1 $0.00042 $0.00843
Opus 5 $0.00021 $0.00421
Sonnet 5 $0.00008 $0.00169
Haiku 4.5 $0.00004 $0.00084

Measured 10d ago against content hash fdb9f26f8286, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-10, from the pricing page.

Security

Grade A, and why

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 10d 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.

skills/merge/SKILL.md · 74 lines

How it starts

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

Merge - Merge PRs, Close Issues, Clean Up Branches

Merge all open PRs and close related issues. Requires the gh CLI to be authenticated (gh auth status).

Phase 0: Get Repository Info

  1. Get GitHub owner/repo: use the cached values from the session context (injected at SessionStart). Only if absent, parse once from git remote get-url origin (SSH: [email protected]:owner/repo.git, HTTPS: https://github.com/owner/repo.git). Use the owner/repo for ALL GitHub calls in this command.

Phase 1: Gather State

  1. Gather state:
    • List all open PRs: gh pr list --json number,title,headRefName,baseRefName,url,body
    • List all open issues with "feature" or "bugfix" labels: gh issue list --label feature --label bugfix --json number,title
    • Read .claude-harness/features/active.json:
      • Check features array for linked issue/PR numbers
      • Check fixes array for linked issue/PR numbers

Phase 2: Build Dependency Graph

  1. Build dependency graph:
    • For each PR, check if its base branch is another feature branch (not main/master)
    • Order PRs so that dependent PRs are merged after their base PRs
    • If PR A base is PR B head branch, merge B first

Phase 3: Pre-merge Validation

  1. Pre-merge validation for each PR (gh pr view {number} --json state,mergeable,reviewDecision,statusCheckRollup):
    • CI status passes
    • No merge conflicts
    • Has required approvals (if any)
    • Report any PRs that cannot be merged and why

Phase 4: Execute Merges

  1. Execute merges in dependency order:
    • Merge the PR: gh pr merge {number} --squash --delete-branch (--delete-branch removes the remote branch and, when the repo is checked out on it, moves you back to the default branch)
    • Find and close any linked issues:
      • Check PR body for "Closes #XX" or "Fixes #XX" (these auto-close on merge)
      • Check .claude-harness/features/active.json for linked issues; close stragglers with gh issue close {number}
    • For fix PRs:
      • Close the fix issue
      • Add comment to original feature issue: gh issue comment {number} --body "Related fix merged: #{fix-issue} - {description}"
    • Delete the local branch if it remains: git branch -d {branch} (safe delete)
    • Update .claude-harness/features/active.json:
      • For features: Set status="passing" in features array
      • For fixes: Set status="passing" in fixes array

Read the full file on GitHub · 74 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. 10d ago First seen · 74 lines · 42 tokens per session scan A fdb9f26f8286

Subscribe to this mod's changes

merge is a skill published in the GitHub repository panayiotism/claude-harness (79 stars, last pushed 1mo ago), licensed MIT. It adds 42 tokens to every session and 843 once invoked, about $0.0002 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-30.