commit-push-pr — Claude Code command: what it does, how to install
Creates a feature branch if needed, commits staged and unstaged edits, pushes to origin, and opens a pull request via GitHub CLI.
/plugin install commit-commands@claude-plugins-officialWhat commit-push-pr does
This command handles the entire flow of publishing code to GitHub in one turn. The agent inspects git status, reads all changes via git diff HEAD, and determines the current branch with git branch --show-current.
If you are currently on main, it branches off into a new branch. It writes a commit message based on the diff, commits the edits, pushes the branch to origin, and runs gh pr create. The prompt instructs the agent to batch all tool calls into a single response without conversational filler.
The command depends on an authenticated GitHub CLI installation. If gh is not installed or lacks repository access, the pull request step will fail.
What it helps with
- branch off
mainbefore committing changes - create a commit with an appropriate message
- push a local branch to
origin - open a pull request using
gh pr create
Example prompts for the agent
- /commit-push-pr
- Commit current changes, push to origin, and open a pull request.
How to install commit-push-pr
1Plugin marketplace
/plugin install commit-commands@claude-plugins-official2Manually: put the files in place
.claude/commands/commit-push-pr.mdCall it with /commit-push-pr. For all projects use ~/.claude/commands/
Manually: put the files in place
~/.codex/prompts/commit-push-pr.mdCall it with /prompts:commit-push-pr. Codex marks this format deprecated in favour of skills
Manually: put the files in place
.github/prompts/commit-push-pr.prompt.mdManually: put the files in place
.gemini/commands/commit-push-pr.tomlGemini stores commands as TOML: the prompt text goes into the prompt field
Questions about commit-push-pr
How do I install commit-push-pr in Claude Code?
Run /plugin install commit-commands@claude-plugins-official in Claude Code.
What does commit-push-pr do?
It inspects current git changes, branches off main if necessary, creates a single commit, pushes to origin, and opens a pull request.
What dependencies does commit-push-pr require?
You need git and an authenticated GitHub CLI (gh) in your PATH. Without gh, the pull request creation step will fail.
Source text
commit-push-pr.md · Apache-2.0
--- allowed-tools: Bash(git checkout --branch:*), Bash(git add:*), Bash(git status:*), Bash(git push:*), Bash(git commit:*), Bash(gh pr create:*) description: Commit, push, and open a PR --- ## Context - Current git status: !`git status` - Current git diff (staged and unstaged changes): !`git diff HEAD` - Current branch: !`git branch --show-current` ## Your task Based on the above changes: 1. Create a new branch if on main 2. Create a single commit with an appropriate message 3. Push the branch to origin 4. Create a pull request using `gh pr create` 5. You have the capability to call multiple tools in a single response. You MUST do all of the above in a single message. Do not use any other tools or do anything else. Do not send any other text or messages besides these tool calls.
© Anthropic · Apache-2.0 · anthropics/claude-plugins-official