aw-merge

An automated workflow for merging the develop branch into main through a pull request, CI checks, and a squash merge. A branch is a separate line of code changes, while a squash merge combines its commits into one commit on the target branch.

In plain words
What is it for?
Use it for weekly develop-to-main merges, previewing pending commits, creating the pull request, waiting for CI, squash-merging, and optionally resetting develop.
Why use it?
It standardizes a recurring release step and reduces the manual checks needed before updating main.

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/zircote-plugins/github-agentic-workflows/aw-merge
Clone the repo
git clone --depth 1 https://github.com/zircote-plugins/github-agentic-workflows

Made for: Claude Code.

Per session 14 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 670 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 $0.00014 $0.00670
Opus 5 $0.00007 $0.00335
Sonnet 5 $0.00003 $0.00134
Haiku 4.5 $0.00001 $0.00067

Measured yesterday against content hash 4348b626bc27, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, from the pricing page.

Security

Grade A, and why

aw-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 yesterday.

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/aw-merge.md · 100 lines

How it starts

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

/aw-merge

Weekly merge of develop into main. Creates a PR, waits for CI, squash merges, and resets develop to the new main HEAD.

Usage

/aw-merge               → Full merge cycle
/aw-merge --dry-run     → Show what would be merged, do not create PR
/aw-merge --no-reset    → Merge but do not reset develop to main after

Flags

  • --dry-run — Show commits on develop ahead of main, do not create PR or merge
  • --no-reset — After merge, do not reset develop to main HEAD (preserves divergent history)

Workflow

You are an autonomous operations agent performing the weekly develop-to-main merge.

Do not prompt the user for input at any point.

Phase 1: Check divergence

git fetch origin main develop
AHEAD=$(git rev-list --count origin/main..origin/develop)

If AHEAD is 0: report "develop is up to date with main. Nothing to merge." and exit.

If --dry-run: show git log --oneline origin/main..origin/develop and exit.

Phase 2: Create PR

gh pr create \
  --draft \
  --repo zircote/github-agentic-workflows \
  --base main \
  --head develop \
  --title "chore: weekly develop merge $(date +%Y-%m-%d)" \
  --body "## Summary

Weekly merge of \`develop\` into \`main\`.

**Commits:** $AHEAD commits since last merge.

\`\`\`
$(git log --oneline origin/main..origin/develop)
\`\`\`

---
_Automated by /aw-merge_"

Mark PR ready:

gh pr ready <PR_NUMBER>

Phase 3: CI and merge

  1. Wait for CI checks: poll gh pr checks every 15 seconds, max 5 minutes
  2. If CI passes (or no checks configured): squash merge
gh pr merge --squash --auto --delete-branch=false
  1. If CI fails: leave PR open, report URL

Phase 4: Reset develop (unless --no-reset)

After successful merge, reset develop to match main:

git checkout develop
git reset --hard origin/main
git push --force-with-lease origin develop
git checkout main
git pull

Final Report

┌──────────────────────────────────────────┐
│ /aw-merge complete                       │
├──────────────────────────────────────────┤
│ Commits merged:  N                       │
│ PR:              URL                     │
│ Merged:          yes/no                  │
│ develop reset:   yes/no/skipped          │
└──────────────────────────────────────────┘

Read the full file on GitHub · 100 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. yesterday First seen · 100 lines · 14 tokens per session scan A 4348b626bc27

Subscribe to this mod's changes

aw-merge is a command published in the GitHub repository zircote-plugins/github-agentic-workflows (2 stars, last pushed 1mo ago), licensed MIT. It adds 14 tokens to every session and 670 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-31.