create-pr

create-pr is a command for Claude Code from desplega-ai/agent-swarm. It costs 19 tokens per session (514 once invoked), scanned A, original, MIT.

A command that opens a GitHub pull request or GitLab merge request from your current branch. It checks the repository, runs required pre-request checks, pushes the branch, and writes the request text.

In plain words
What is it for?
Use it when your code is ready to propose merging into another branch, usually main. It supports an optional target branch and detects whether the repository uses GitHub or GitLab.
Why use it?
It removes the repetitive work of checking your branch, running project checks, pushing changes, and preparing a request summary. It stops before opening the request if required checks fail.

Command for Claude Code

Written for Claude Code: argument-hint in frontmatter. Also seen: mentions CLAUDE.md.

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/desplega-ai/agent-swarm/create-pr
Clone the repo
git clone --depth 1 https://github.com/desplega-ai/agent-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 create-pr

README.md
[![agentmods](https://agentmods.dev/badge/commands/desplega-ai/agent-swarm/create-pr.svg)](https://agentmods.dev/commands/desplega-ai/agent-swarm/create-pr)
Your own site
<a href="https://agentmods.dev/commands/desplega-ai/agent-swarm/create-pr"><img src="https://agentmods.dev/badge/commands/desplega-ai/agent-swarm/create-pr.svg" alt="Measured on agentmods" height="20"></a>
Per session 19 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 514 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.1 $0.00019 $0.00514
Opus 5 $0.00010 $0.00257
Sonnet 5 $0.00004 $0.00103
Haiku 4.5 $0.00002 $0.00051

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

Security

Grade A, and why

create-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 6d 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.

plugin/commands/create-pr.md · 40 lines

What it actually says

Create Pull Request / Merge Request

Create a PR (GitHub) or MR (GitLab) from the current branch with an auto-generated title and description.

Provider detection: Check the remote URL:

  • If github.com → use gh CLI
  • If gitlab.com or gitlab. → use glab CLI

Arguments

  • base-branch (optional): Branch to merge into (defaults to main or repo default)

Prerequisites

You should be working in a repository cloned to /workspace/personal/<repo-name>.

Workflow

  1. Verify state — confirm you're in a git repo, not on main/master, and have commits to push.
  2. Run PR checks (MANDATORY) — Run ALL checks listed in the "PR Checks" section of your Repository Guidelines. Run each command/task sequentially. If ANY check fails, fix the issue and re-run until all pass. If no guidelines are defined, check the project's CLAUDE.md for a pre-PR checklist and run those. Do NOT proceed until all checks pass.
  3. Push the branchgit push -u origin HEAD
  4. Gather context — review commit messages and changed files since diverging from base.
  5. Generate title and description:
    • Title: Concise summary (conventional commit style if the repo uses it)
    • Description: Summary of changes, notable items, testing done, related issues
  6. Create the PR/MR using gh pr create or glab mr create.
  7. Check CI status — After creating the PR, wait ~30 seconds, then check CI with gh pr checks <pr-number> (GitHub) or glab mr view --json pipelines (GitLab). If any check is failing, investigate the failure, fix it, push the fix, and re-check. Repeat until CI is green.
  8. Report the PR/MR URL and CI status.

Tips

  • Link related issues using Fixes #123 or Closes #123 in the description
  • Keep PRs focused — one logical change per PR
  • If the branch has many commits, summarize the overall change rather than listing each commit
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. 6d ago First seen · 40 lines · 19 tokens per session scan A cd55ee31c8f3

Subscribe to this mod's changes

create-pr is a command published in the GitHub repository desplega-ai/agent-swarm (742 stars, last pushed today), licensed MIT. It adds 19 tokens to every session and 514 once invoked, about $0.0001 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.