Home › Agent workflows › /pr-description slash command (Claude Code)
/pr-description slash command (Claude Code)
A Claude Code /pr-description command that drafts a pull request title and body from the branch diff, without pushing.
Claude Code (CLAUDE.md)Agent workflows
How to use
Save this as .claude/commands/pr-description.md in your repository root, commit it, and your agent will pick it up automatically. Edit the commands to match your project.
.claude/commands/pr-description.mdDownload ---
description: Draft a PR title and description from the current branch's changes
allowed-tools: Bash(git diff:*), Bash(git log:*), Bash(git branch:*), Read, Grep
argument-hint: [base branch, default main]
---
## Context
- Current branch: !`git branch --show-current`
- Commits: !`git log --oneline main..HEAD`
- Files changed: !`git diff --stat main...HEAD`
## Task
If I passed a base branch ("$ARGUMENTS"), use it instead of `main` in the commands below and re-run them.
Read the diff (`git diff main...HEAD`) and the most important changed files, then write a pull request draft in Markdown. Do not push, open the PR, or run `gh` commands; just print the draft.
Use this structure:
**Title:** Conventional-style summary under 70 chars.
### What
2-4 sentences describing the change from the reviewer's point of view.
### Why
The problem or ticket this solves (link issue numbers found in commit messages).
### How to test
Exact commands and manual steps.
### Risk and rollout
Migrations, config/env changes, feature flags, breaking changes, performance concerns. Write "Low risk" with a reason if none.
### Screenshots
Placeholder only if UI files changed.
Keep it factual: describe only what is in the diff, and flag anything that looks unfinished (TODOs, commented-out code, missing tests) in a final "Notes for reviewers" list.