commit-update-pr

A command that finishes a coding change by committing it to Git, uploading it to the remote repository, creating or updating a pull request, and checking its automated tests.

In plain words
What is it for?
Use it after making code changes when you want to stage files, write a commit, push a branch, manage its pull request, and monitor the test results.
Why use it?
It brings several release steps into one workflow, so you do not have to remember each GitHub and CI action separately. It can also respond to failed checks.

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/samuelclay/newsblur/commit-update-pr
Clone the repo
git clone --depth 1 https://github.com/samuelclay/NewsBlur

Made for: Claude Code.

Per session 16 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 1,046 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.00016 $0.01046
Opus 5 $0.00008 $0.00523
Sonnet 5 $0.00003 $0.00209
Haiku 4.5 $0.00002 $0.00105

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

Security

Grade A, and why

commit-update-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 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/commit-update-pr.md · 102 lines

How it starts

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

Your task

Commit all staged/unstaged changes, push to remote, create or update the PR, then watch CI until it finishes and fix any failures.

Arguments provided: {{ arguments }}

Steps to execute

  1. Check git status to see what changes exist:

    git status
    git diff --stat
    git diff --staged --stat
    
  2. Check for existing PR for the current branch:

    gh pr view --json number,title,url,state 2>/dev/null
    
    • If a PR exists and is OPEN, note its URL and number - we'll update it
    • If no PR exists or it's closed/merged, we'll create a new one
  3. Stage all changes (if there are unstaged changes):

    git add -A
    
  4. Create the commit following the commit message conventions:

    • Run git log --oneline -5 to see recent commit style
    • Run git diff --staged to understand the changes
    • Write a concise commit message summarizing the changes
    • Use the format:
      git commit -m "$(cat <<'EOF'
      <commit message here>
      
      Co-Authored-By: Claude Opus 4.5 <[email protected]>
      EOF
      )"
      
  5. Push to remote:

    git push -u origin HEAD
    
  6. Create or update the PR:

    If a PR already exists:

    • The push already updated the PR
    • Note: "Updated existing PR: "

    If no PR exists:

    • Create a new PR:
      gh pr create --title "<title>" --body "$(cat <<'EOF'
      ## Summary
      <1-3 bullet points summarizing the changes>
      
      ## Test plan
      - [ ] <testing checklist items>
      
      ---
      Generated with [Claude Code](https://claude.com/claude-code)
      EOF
      )"
      
  7. Watch CI and auto-fix failures — do NOT stop after pushing. Monitor the PR's checks until every check has a terminal status (pass, fail, skipped, cancelled), and fix any failures before handing back to the user.

    a. Poll for status. After pushing, wait ~30s for CI to register, then:

    gh pr checks <PR_NUMBER>
    

    The first column is the check name, the second is status (pending, pass, fail, skipping, cancelled). Re-run this periodically. Do not chain sleep commands to wait — prefer run_in_background so you don't block, and poll by calling gh pr checks again on a reasonable cadence (30–60s). Keep going until no check shows pending.

Read the full file on GitHub · 102 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 · 102 lines · 16 tokens per session scan A e981e0f7d7e7

Subscribe to this mod's changes

commit-update-pr is a command published in the GitHub repository samuelclay/NewsBlur (7,600 stars, last pushed 3d ago), licensed MIT. It adds 16 tokens to every session and 1,046 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.