Committing code
How Claude Code helps you create git commits with the Commit Commands plugin, what /commit does, and how it stays aligned with your repo and safety rules.
Claude Code can run git through its shell tools. For turning work into commits without retyping the same git dance, the upstream Commit Commands plugin in the Claude Code repo exposes slash commands.
Commit Commands plugin
The Commit Commands plugin is meant to cut context switching: one command instead of a chain of git invocations. It ships with the Claude Code project so the commands are available in typical setups.
/commit, create a commit
/commit is designed to analyze staged and unstaged changes, match your project’s commit style using recent history, draft a message (including conventional-commit style where appropriate), stage the right files, and create a single commit.
Documented behavior includes:
- Respecting what is already a sensible set of files to stage (and avoiding obvious secret paths such as
.envorcredentials.jsonin examples from upstream docs). - Using
git log-style context so new messages do not fight your existing style.
If you need multiple commits (for example one logical change per commit), you can run /commit more than once as you go; pair that with a Pushing or Opening pull requests flow when the branch is ready to share.
Permissions and trust
git commit is write access to your repository. In Claude Code, allow / ask / deny rules and permission modes still apply. Tighten rules for git in shared or sensitive repos; see the workshop Permissions page and Anthropic’s Configure permissions.
Natural language
You can also ask in plain language: commit these changes with a message that matches our last ten commits, the same Commit Commands flow is the structured version of that work.
Next: Pushing, get commits to the remote. Or skip ahead to Opening pull requests for the all-in-one /commit-push-pr path.
Sources: Commit Commands README, plugin overview, /commit.
Launching a Security Review
Prompt patterns for asking an AI agent to review your repository, prioritize findings, and suggest fixes without replacing a professional audit.
Pushing
Pushing branches to GitHub with Claude Code, standalone git push, how it fits with commit workflows, and permission expectations.