swarm: Command for Claude Code

.claude/commands/cherry_pick_pr.md

cherry_pick_pr is a command for Claude Code from swarm-ai-research/swarm. It costs 0 tokens per session (626 once invoked), scanned A, original, MIT.

A command for copying one or more existing Git commits onto a new branch created from main, then opening a pull request. Cherry-picking means applying selected commits without bringing along the rest of a branch.

In plain words
What is it for?
Use it with commit IDs to validate the commits, create a clean branch, apply them in order, and open a pull request.
Why use it?
It helps recover commits that landed on the wrong branch or separate selected changes into their own reviewable pull request.

Command for Claude Code

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

This is swarm-ai-research/swarm's own configuration. It tells Claude Code how to work on swarm 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 swarm configures →

Reuse

Borrowing it

Nothing to install: this file belongs to swarm-ai-research/swarm. 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/swarm-ai-research/swarm/main/.claude/commands/cherry_pick_pr.md
Clone the repo
git clone --depth 1 https://github.com/swarm-ai-research/swarm

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 cherry_pick_pr

README.md
[![agentmods](https://agentmods.dev/badge/commands/swarm-ai-research/swarm/cherry_pick_pr.svg)](https://agentmods.dev/commands/swarm-ai-research/swarm/cherry_pick_pr)
Your own site
<a href="https://agentmods.dev/commands/swarm-ai-research/swarm/cherry_pick_pr"><img src="https://agentmods.dev/badge/commands/swarm-ai-research/swarm/cherry_pick_pr.svg" alt="Measured on agentmods" 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 626 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.00626
Opus 5 $0.00000 $0.00313
Sonnet 5 $0.00000 $0.00125
Haiku 4.5 $0.00000 $0.00063

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

Security

Grade A, and why

cherry_pick_pr 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 8d 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/cherry_pick_pr.md · 51 lines

How it starts

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

/cherry_pick_pr

Cherry-pick one or more commits onto a new branch from main and open a PR. Useful when a commit landed on the wrong branch or you want to split a multi-commit branch into separate PRs.

Usage

/cherry_pick_pr <commit-sha> [commit-sha...] [branch-name]

Examples:

  • /cherry_pick_pr abc1234 (cherry-pick one commit, auto-generate branch name)
  • /cherry_pick_pr abc1234 def5678 fix/gastown-bugs (cherry-pick two commits onto a named branch)

Behavior

  1. Validate inputs:

    • Verify each commit SHA exists: git cat-file -t <sha>.
    • If any SHA is invalid, abort with an error.
    • Show the commit messages for confirmation: git log --oneline -1 <sha> for each.
  2. Create a clean branch from main:

    • git fetch origin main
    • git checkout -b <branch-name> origin/main
    • If no branch name provided, derive one from the first commit's message (e.g. fix/circuit-breaker-reset).
  3. Cherry-pick commits:

    • For each SHA in order: git cherry-pick <sha> --no-commit, then git commit --no-verify with the original message plus Co-Authored-By: Claude Opus 4.6 <[email protected]>.
    • If a cherry-pick has conflicts, stop and report the conflicts. Do not auto-resolve.
  4. Push and open PR:

    • git push -u origin <branch-name>
    • gh pr create --head <branch-name> --base main --title "..." --body "..."
    • Title: derived from commit message(s). If multiple commits, summarize.
    • Body format: ## Summary (bullet points from each commit), ## Test plan, Claude Code footer.
  5. Clean up source branch (optional):

    • If the commits came from a feature branch (not main), ask the user if they want to remove those commits from the source branch.
    • If yes: git checkout <source-branch> && git rebase --onto <sha>~1 <sha> <source-branch> (for single commit) or interactive rebase guidance for multiple.
    • If no: leave the source branch as-is.
    • Never force-push the source branch without explicit confirmation.

Read the full file on GitHub · 51 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. 8d ago First seen · 51 lines · 0 tokens per session scan A 6b25690ffa88

Subscribe to this mod's changes

cherry_pick_pr is a command published in the GitHub repository swarm-ai-research/swarm (41 stars, last pushed yesterday), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 626 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-08-30.