Vibe Coding for Production
Claude GitHub integration

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

Repository with a remote (for example origin pointing at GitHub).

GitHub CLI installed and authenticated, for example:

  • brew install gh (macOS)
  • gh auth login
Branch with commits you want reviewed, either from Committing code or your own 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:

Create a new branch if you are still on main (or equivalent default).
Commit with an appropriate message (not only the last diff, the plugin can use all commits on the branch for context).
git push the branch to origin.
Run 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.

On this page