Draft a GitHub pull request in Claude Code with a /pr slash command A developer published a reusable Claude Code slash command, saved as .claude/commands/pr.md, that drafts a GitHub pull request from the current branch by running git status, log and diff, then proposing a title and body with a summary, test plan and follow-ups. The command uses $ARGUMENTS to accept a base branch or extra instructions and is written to wait for confirmation before running gh pr create, with explicit rules against force-pushing, merging or adding unnamed reviewers. If you keep pasting the branch diff and "write a PR title and body, then wait" into Claude Code, turn that prompt into a slash command. The file name becomes the command; $ARGUMENTS lets you name the base branch or add extra instructions. Save this as .claude/commands/pr.md : --- description: "Draft a GitHub pull request from the current branch" argument-hint: " base branch | extra instructions " --- Draft a GitHub pull request for the current branch. Do not create it until I confirm. 1. Run git status -sb , git log --oneline -15 , and git diff origin/HEAD...HEAD or main...HEAD if origin/HEAD is missing . If there is no unique commit versus the base, stop and say so. 2. If I passed arguments $ARGUMENTS , treat the first token as a base branch when it looks like one main , master , develop , or origin/... . Treat the rest as extra instructions. 3. Propose a PR title and a body with a short summary, a test plan, and any follow-ups. Do not add AI attribution unless I ask. 4. Show the title and body and wait for me to confirm before running gh pr create . Never force-push, never merge, and never add reviewers I did not name. Use it as /pr , /pr main , or /pr develop include a migration note . Slash commands are markdown files in .claude/commands . Claude Code injects the file as the prompt and replaces $ARGUMENTS with whatever you type after the command. Keeping "wait for confirm" and "never force-push or merge" in the command reduces unattended PR creation. gh pr create if you also want a permissions bump. /commit command so the branch messages and the PR body stay consistent. I keep copy-ready Claude Code configs CLAUDE.md templates, slash commands, hooks, permission rules in Vildanden Agent Config . There's a free sample: https://justly-mia-429.rehost.page/ https://justly-mia-429.rehost.page/