Opening pull requests
Creating GitHub pull requests from Claude Code using the GitHub CLI and the /commit-push-pr workflow, auth, branch handling, and PR bodies.
To open a pull request on GitHub from Claude Code, you typically rely on the GitHub CLI command gh pr create, either directly in chat or inside the /commit-push-pr slash command from the Commit Commands plugin.
Prerequisites
origin pointing at GitHub).GitHub CLI installed and authenticated, for example:
brew install gh(macOS)gh auth login
git workflow, then Pushing if the PR tool expects the branch on the remote./commit-push-pr, one-shot workflow
/commit-push-pr is documented to:
main (or equivalent default).git push the branch to origin.gh pr create and return the PR URL.PR descriptions in that flow are described upstream as including a short summary (often bullet points), a test-plan style checklist, and Claude Code attribution. Treat that as a starting point, edit on GitHub if your team has a stricter template.
Feature branches and multiple commits
A documented pattern: use /commit a few times while building a feature, then /commit-push-pr when the unit of work is ready to review, the PR reflects all commits on the branch, not a single diff.
Without the slash command
You can still say: create a PR from this branch with title X and body Y, the agent will need Bash(gh pr create:*) (or equivalent) allowed, plus the same gh auth you would use locally.
Next: Reviewing pull requests, what reviewers and /code-review do once the PR exists.
Sources: Commit Commands README, /commit-push-pr, feature-branch workflow; llms.txt command examples in the anthropics/claude-code tree (search for /commit-push-pr), file layout can change between releases.