mcp-memory-service: Command for Claude Code

.claude/commands/merge-sweep.md

merge-sweep is a command for Claude Code from doobidoo/mcp-memory-service. It costs 0 tokens per session (511 once invoked), scanned A, original, Apache-2.0.

A command for coordinating the merging of open GitHub pull requests, which are proposed code changes awaiting review. It checks their status, reviews possible blockers, and sorts them into merge, quick-fix, or maintainer-decision groups.

In plain words
What is it for?
It inventories open pull requests, checks CI results and conflicts, identifies unresolved review threads, and runs scoped tests when a local check is needed. It can also point out small fixes or cases that need a maintainer's judgment.
Why use it?
It removes the need to inspect every open pull request manually and helps avoid merging changes with failed checks, unresolved review discussions, or conflicts. It also keeps temporary testing away from a shared main working folder.

Command for Claude Code

Written for Claude Code: installed under .claude/. Also seen: mentions CLAUDE.md.

This is doobidoo/mcp-memory-service's own configuration. It tells Claude Code how to work on mcp-memory-service itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything mcp-memory-service configures →

About the project

mcp-memory-service is a self-hosted memory backend that lets AI agents store and retrieve shared project context through REST, MCP, OAuth, a command-line interface, and a dashboard. It is intended for agent pipelines and clients such as LangGraph, CrewAI, AutoGen, Claude Desktop, and OpenCode, with support for knowledge graphs and memory consolidation. The catalogue includes skills, agents, commands, instructions, hooks, a setting, an MCP entry, and a plugin for its workflows.

doobidoo/mcp-memory-service · 2,021 stars · on GitHub

Reuse

Borrowing it

Nothing to install: this file belongs to doobidoo/mcp-memory-service. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/doobidoo/mcp-memory-service/main/.claude/commands/merge-sweep.md
Clone the repo
git clone --depth 1 https://github.com/doobidoo/mcp-memory-service

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 merge-sweep

README.md
[![agentmods](https://agentmods.dev/badge/commands/doobidoo/mcp-memory-service/merge-sweep/github.svg)](https://agentmods.dev/commands/doobidoo/mcp-memory-service/merge-sweep)
Your own site
<a href="https://agentmods.dev/commands/doobidoo/mcp-memory-service/merge-sweep"><img src="https://agentmods.dev/badge/commands/doobidoo/mcp-memory-service/merge-sweep/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-sweep

Your own site · 80×15
<a href="https://agentmods.dev/commands/doobidoo/mcp-memory-service/merge-sweep"><img src="https://agentmods.dev/badge/commands/doobidoo/mcp-memory-service/merge-sweep.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 511 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.00000 $0.00511
Opus 5.5 $0.00000 $0.00204
Sonnet 5.5 $0.00000 $0.00102
Haiku 4.5 $0.00000 $0.00051

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

Security

Grade A, and why

merge-sweep 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 15d 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/commands/merge-sweep.md · 44 lines

What it actually says

/merge-sweep — Merge Open PRs With Minimal Effort

Role: merge coordinator for open PRs (GitHub, gh). Goal: merge as many PRs as possible with minimal effort.

1. Inventory

gh pr list --state open --json number,title,author,headRefOid,isDraft,mergeable,mergeStateStatus,labels

2. Check each PR — read only, change nothing

  • CI per head SHA (gh api repos/{owner}/{repo}/commits/<sha>/check-runs), not gh pr checks.
  • Unresolved review threads (GraphQL reviewThreads, isResolved). ResolveThreads has no bypass.
  • Conflicts or drift against main. A fork PR showing action_required means the run needs approval.
  • Dependabot: did the bump widen a load-bearing constraint?

Only when a question needs a local answer: worktree under ../worktrees/pr-<N>, run .venv/bin/pytest scoped there. Never touch the main tree — several sessions share it.

3. Classify

  • MERGE: green, no open threads, no conflicts, automated-review findings (Greptile summary and confidence) read, and for contributor PRs the diff reviewed (/pr-review)
  • QUICK-FIX: under 10 minutes (rebase, answer a thread, approve a run) — name the fix
  • DECISION: needs the maintainer's judgment
  • SKIP: draft, red for a real reason, large

4. Report

One table: PR | title | category | reason (one line) | evidence command. Then STOP. Merge nothing.

5. After approval

  • Merge one at a time: gh pr merge <N> --squash --admin --match-head-commit <sha>. Immediately before each merge, re-fetch the head SHA, its threads and its check-runs; if the SHA changed or a required check is not green, stop and re-classify that PR.
  • Strict policy: after each merge, update the next PR and wait for green CI.
  • Do not run collect_changelog.py — collecting fragments belongs to /release.
  • Finally remove the worktrees and sync the GitLab mirror with a proven fast-forward (see CLAUDE.md "Source Control & Hosting").
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. 15d ago First seen · 44 lines · 0 tokens per session scan A 9b8f77e33258

Subscribe to this mod's changes

merge-sweep is a command published in the GitHub repository doobidoo/mcp-memory-service (2,021 stars, last pushed yesterday), licensed Apache-2.0. It costs nothing until one of its globs matches a file; then it loads 511 tokens. 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-10-04.