What it is
The Commit Commands Plugin automates common git operations so you switch context less and type fewer commands by hand. You run a single slash command instead of several git commands. The plugin ships with three commands: /commit, /commit-push-pr, and /clean_gone. It is authored by Anthropic and is at version 1.0.0.
/commit creates a git commit with an automatically generated message based on your staged and unstaged changes. It works in these steps:
- Analyzes the current git status and reviews your changes.
- Examines recent commit messages so the new message matches your repository's style.
- Drafts the message, stages the relevant files and creates the commit.
The drafted message follows conventional commit practices and includes Claude Code attribution. The command also avoids committing files with secrets, such as .env and credentials.json.
/commit-push-pr runs the full workflow in one step:
- Creates a new branch if you are currently on main.
- Stages and commits your changes.
- Pushes the branch to origin.
- Creates a pull request with gh pr create and gives you the PR URL.
It analyzes all commits in the branch, not just the latest. The PR description includes a 1-3 bullet summary of changes, a test plan checklist and Claude Code attribution.
/clean_gone removes local branches that have been deleted from the remote repository. It lists local branches to find those with [gone] status, then removes any worktrees associated with them. After that it deletes the [gone] branches and reports what was removed, or tells you that no cleanup was needed. It handles both regular branches and worktree branches, and it removes worktrees before deleting branches.
Who it's for
- Developers using Claude Code who want to commit without writing commit messages by hand
- Developers who want to commit, push and open a GitHub pull request in one step
- Developers whose local branch list is cluttered with branches already deleted on the remote
- Teams that want commit messages to match their repository's existing style
Requirements
Requirements
- Git must be installed and configured
- The repository must be a git repository with a remote
- For
/commit-push-pr: GitHub CLI (gh) must be installed and authenticated - For
/commit-push-pr: the repository must have a remote namedorigin
Setup
Plugin availability
This plugin is included in the Claude Code repository. The commands are automatically available when using Claude Code.
Install GitHub CLI (needed for /commit-push-pr)
Install GitHub CLI with Homebrew on macOS. On other systems, see the GitHub CLI installation page (https://cli.github.com/).
bashbrew install ghAuthenticate GitHub CLI
Authenticate
ghso that/commit-push-prcan create pull requests.bashgh auth login
هاد البلَغن من Anthropic بيعطيك أوامر سلاش بسيطة جوّا Claude Code لتعمل commit وpush وتفتح pull request بخطوة وحدة. كمان بينضّفلك البرانشات المحلية يلي انمسحت من الريموت.
Examples
Commit your changes
bash# Make some changes to your code
# Then simply run:
/commit
# Claude will:
# - Review your changes
# - Stage the files
# - Create a commit with an appropriate message
# - Show you the commit statusWhat it does: Run /commit after making changes. Claude reviews the changes, stages files and commits with a generated message that matches your repo's style.
Commit, push and open a PR
bash# Make your changes
# Then run:
/commit-push-pr
# Claude will:
# - Create a feature branch (if needed)
# - Commit your changes
# - Push to remote
# - Open a PR with summary and test plan
# - Give you the PR URL to reviewWhat it does: This single command covers branch creation, commit, push and PR creation through the GitHub CLI, then returns the PR URL.
Clean up stale branches
bash# After PRs are merged and remote branches are deleted
/clean_gone
# Claude will:
# - Find all branches marked as [gone]
# - Remove any associated worktrees
# - Delete the stale local branches
# - Report what was cleaned upWhat it does: This removes local branches, and their worktrees, whose remote counterparts have been deleted.
Feature branch workflow
bash# Develop feature across multiple commits
/commit # First commit
# More changes
/commit # Second commit
# Ready to create PR
/commit-push-prWhat it does: Use /commit for routine commits during development, then /commit-push-pr once the feature is ready. The PR description draws on the full branch history.