Git Workflow
Automates commits, PRs, and reviews straight from Claude Code.
Automates commits, PRs, and reviews straight from Claude Code.
What it is
Claude Code can take over your entire git workflow: generate commit messages from git diff, open PRs with the gh CLI, review your code before you push. No more copy-pasted messages, no more half-baked PR descriptions.
Install / Setup
You'll want git and the gh CLI installed. After that it's just config:
Option 1 โ CLAUDE.md + plugin:
## Git
- Commit messages in English
- Conventional commits (feat/fix/docs/refactor)
- Before committing: check git diff, NEVER `--no-verify`
- Never force-push main
Plus enable Anthropic's commit-commands plugin (/plugins) โ gives you /commit and /commit-push-pr.
Option 2 โ Prompt Claude Code:
Set up the git workflow for me:
1. Install the Anthropic plugin "commit-commands" via /plugins.
2. Add git rules to my CLAUDE.md (English, conventional commits, never --no-verify, no force-push on main).
3. Check that the gh CLI is installed and logged in โ if not, walk me through it.
Liking this?
Inside the community I show you how I run all of this day-to-day โ live sessions, direct feedback on your setup, and my full configs.
Use cases
- Automatic commits โ
/commitโ Claude reads the diff, writes the message, commits. - PR in one shot โ
/commit-push-prโ commit + push + PR with title and body. - Self-review before push โ "Review every change since the last commit for bugs, security issues, edge cases."
- Interactive rebase cleanup โ Claude sorts commits, proposes squash groups.
- Changelog generation โ Turn merged PRs since the last tag into a release changelog.
Pro tip
Spell it out in your CLAUDE.md: "NEVER --no-verify or --no-gpg-sign on commit, NEVER force-push main." Claude respects it and you dodge the day an agent nukes your main branch. If a pre-commit hook fails: fix the cause, don't bypass it.
๐ Inside the community we build complete automation systems and workflows that actually run your day. โ Join the Claude Code Mastery Community
Updated regularly โ follow @vine.codes for more.
Want more?