cpr

cpr is a command for Claude Code from KaimingWan/oh-my-kiro. It costs 0 tokens per session (601 once invoked), scanned A, original, MIT.

A command that commits changes to Git, sends them to the remote repository, and opens a pull request. A pull request is a request for others to review and merge a set of code changes.

In plain words
What is it for?
Use it to stage and commit the current repository, push the branch, detect the likely base branch, and create a pull request after confirmation.
Why use it?
It groups the routine release steps and helps ensure the changes go to the intended repository and target branch.

Command for Claude Code

Written for Claude Code: a Claude Code command (commands/*.md). Also seen: positional $N argument.

Good fit Use it to stage and commit the current repository, push the branch, detect the likely base branch, and create a pull request after confirmation.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/kaimingwan/oh-my-kiro/cpr
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.

Clone the repo
git clone --depth 1 https://github.com/KaimingWan/oh-my-kiro

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 cpr

README.md
[![agentmods](https://agentmods.dev/badge/commands/kaimingwan/oh-my-kiro/cpr/github.svg)](https://agentmods.dev/commands/kaimingwan/oh-my-kiro/cpr)
Your own site
<a href="https://agentmods.dev/commands/kaimingwan/oh-my-kiro/cpr"><img src="https://agentmods.dev/badge/commands/kaimingwan/oh-my-kiro/cpr/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 cpr

Your own site · 80×15
<a href="https://agentmods.dev/commands/kaimingwan/oh-my-kiro/cpr"><img src="https://agentmods.dev/badge/commands/kaimingwan/oh-my-kiro/cpr.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 601 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.00601
Opus 5 $0.00000 $0.00300
Sonnet 5 $0.00000 $0.00120
Haiku 4.5 $0.00000 $0.00060

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

Security

Grade A, and why

cpr 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 9d 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.

commands/cpr.md · 65 lines

How it starts

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

Commit all changes, push to remote, and create a Pull Request. (CPR = Commit Push PR)

Scope

Only operate on the current git repository. NEVER cd into or commit/push other repositories.

Steps

Step 1: Stage & Commit

  1. git add -A && git status --short — show what's staged
  2. Ask user for commit message if not provided, or generate one from the diff
  3. git commit -m "<message>"
  4. git push
  5. Report: commit hash + push result

Step 2: Detect PR Target Branch

current_branch=$(git branch --show-current)

# 1. Check reflog for source branch (works for worktree branches)
created_from=$(git reflog show "$current_branch" --format="%gs" | tail -1 | sed 's/.*Created from //')
base=$(echo "$created_from" | sed 's#refs/remotes/origin/##; s#refs/heads/##')

# 2. If source == self (created from remote tracking branch), fallback to remote default
if [ "$base" = "$current_branch" ] || [ -z "$base" ]; then
  base=$(git symbolic-ref refs/remotes/origin/HEAD 2>/dev/null | sed 's#refs/remotes/origin/##')
  [ -z "$base" ] && base="main"
fi

echo "PR_TARGET=$base"

Show the detected target branch to user and ask for confirmation:

  • "PR target: <base>. Confirm? (or specify a different branch)"
  • If user provides a different branch, use that instead.

Step 3: Create PR

gh pr create --base "$base" --title "<generate from commits>" --body "<summary of changes>"

Report: "PR created: . Target: <base>."

Step 4: Worktree Cleanup (only if in worktree)

wt_dir=$(git rev-parse --git-common-dir 2>/dev/null)
git_dir=$(git rev-parse --git-dir 2>/dev/null)
if [ "$wt_dir" != "$git_dir" ]; then
  worktree_path=$(pwd)
  cd "$(git worktree list | head -1 | awk '{print $1}')"
  git worktree remove "$worktree_path" --force
  echo "Worktree cleaned up."
fi

Edge Cases

  • No gh CLI: Warn user, skip PR creation. Just commit + push.
  • No changes to commit: Skip commit, still create PR if there are pushed commits not yet in a PR.
  • User on main/default branch: Warn "You're on the default branch, PR doesn't make sense." and abort.

Read the full file on GitHub · 65 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. 9d ago First seen · 65 lines · 0 tokens per session scan A f3ed44ba0647

Subscribe to this mod's changes

cpr is a command published in the GitHub repository KaimingWan/oh-my-kiro (103 stars, last pushed 5mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 601 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.