Claude Code drives git from your terminal. Say what you need in plain English and the commit, branch, or PR lands with your team's conventions baked in.
Stop configuring. Start building.
SaaS builder templates with AI orchestration.
Problem: You wrapped a batch of edits with Claude Code and now the diff is sitting there, unstaged, and you need the history to read cleanly.
Quick Win: Once Claude wraps the work, ask for a commit in plain English:
claude "commit these changes"The diff gets read, a real commit message gets written, and git commit runs on your behalf. No fake config, no plugins, nothing to install.
Git commands run straight through your terminal when Claude Code is open. There's no "auto-commit" mode to toggle and nothing to wire up. You ask, it happens.
Here's what Claude handles:
gh CLI if installedBecause Claude can see the git history and follow the thread of your work, the commit messages describe what actually changed and why.
Skip fake config commands. Drop your team's commit rules into CLAUDE.md instead:
Stop configuring. Start building.
SaaS builder templates with AI orchestration.
Stop configuring. Start building.
SaaS builder templates with AI orchestration.
## Git Conventions
- Use conventional commits: feat:, fix:, docs:, refactor:
- Keep subject lines under 72 characters
- Always run tests before committing
- Create feature branches for new workAsk for a commit from then on and Claude falls in line with whatever you wrote.
# Claude just finished implementing a feature
claude "commit these changes"
# Or be more specific
claude "commit with message: add user authentication flow"# Start new work on a branch
claude "create a feature branch called auth-improvements and switch to it"
# Make changes, then commit
claude "commit the auth changes with a descriptive message"
# When ready, create a PR
claude "push this branch and create a PR with a summary of changes"# See what changed first
claude "show me a summary of all uncommitted changes"
# Then commit selectively
claude "commit only the changes in src/auth/ with message: refactor auth module"Commits and PRs from Claude carry attribution by default, so your team (and future you) can tell which work was AI-assisted. Whatever lands in the message is governed by the attribution key inside settings.json.
Commits get two lines tacked on:
Generated with Claude Code (https://claude.com/claude-code)
Co-Authored-By: Claude Sonnet 4.5 <noreply>Line one is plain text. Line two is a git trailer, a format that GitHub (and other hosts) parses to surface Claude as a co-author on the commit.
For pull requests, the attribution lands as a shorter blurb in the description:
Generated with Claude Code (https://claude.com/claude-code)Commit and PR attribution each have their own key under settings.json:
{
"attribution": {
"commit": "Generated with AI\n\nCo-Authored-By: AI Assistant <your-ai-alias>",
"pr": "AI-assisted PR"
}
}Rewrite the body text, the Co-Authored-By name and email, or every piece at once. The \n\n is what separates the message from the trailer block, and the git trailers format requires it.
Empty string on either key turns the line off:
{
"attribution": {
"commit": "",
"pr": ""
}
}That hides attribution on commits, PRs, or both. Handy for teams that log AI usage somewhere else.
The older includeCoAuthoredBy boolean is on its way out. If you had "includeCoAuthoredBy": false, port it over to attribution:
// Old (deprecated)
{ "includeCoAuthoredBy": false }
// New (recommended)
{
"attribution": {
"commit": "",
"pr": ""
}
}Finer control falls out of the new setting. Commit attribution can switch off while PR attribution stays put, or the reverse. Drop the block into whichever scope you want it to cover, whether that's user, project, or local.
Error: "nothing to commit". Fix: either Claude already ran the commit, or the files never made it into the index. Have Claude take a look:
claude "what's the current git status?"Error: "permission denied" on push. Fix: the remote wants auth. Credentials aren't something Claude can hand over for you, though it can walk you through the diagnosis:
claude "help me debug this git push error"Error: Merge conflicts. Fix: Claude can walk them out:
claude "there are merge conflicts in auth.js - resolve them keeping our new changes"Git inside Claude Code has no setup step. Tell Claude what git move you need, and the commands run. That's the whole trick.