One-command git workflow for Claude Code: auto-stage, conventional commit messages, optional semantic versioning, and push.
- Auto-stage —
git add -Aall changes automatically - Sensitive file detection — warns before staging
.env,*.pem,*.key, credentials, and other secrets - Smart commit messages — analyzes your diff and generates Conventional Commits (
feat:,fix:,refactor:, etc.) - Adapts to your style — reads recent commit history and matches the language & conventions of your project
- Respects CLAUDE.md — if your project defines commit conventions in
CLAUDE.md, those take priority - Semantic versioning — optional automatic version bumping via
VERSIONfile (major/minor/patch) - Push in one step — commits and pushes to origin with helpful error messages on failure (or skip with
--no-push) - Context pre-fetching — uses Claude Code's
!backtick syntax to gather git context before execution
bash <(curl -fsSL https://raw.githubusercontent.com/atompilot/claude-code-auto-commit/main/install.sh)This installs auto-commit.md to ~/.claude/commands/, making it available globally in Claude Code.
git clone https://github.com/atompilot/claude-code-auto-commit.git
cd claude-code-auto-commit
./install.shcp commands/auto-commit.md ~/.claude/commands/auto-commit.mdIn Claude Code, type:
/auto-commit
That's it. Claude will:
- Check for sensitive files (
.env, keys, credentials) - Stage all changes
- Analyze the diff
- Generate a conventional commit message (respecting
CLAUDE.mdconventions if present) - Bump the version (if
VERSIONfile exists) - Commit and push
If your project has a VERSION file in the root, the version is bumped automatically based on the commit type. You can also force a specific bump level:
/auto-commit --major # Breaking changes: 1.2.3 → 2.0.0
/auto-commit --minor # New features: 1.2.3 → 1.3.0
/auto-commit --patch # Bug fixes: 1.2.3 → 1.2.4
/auto-commit --no-push # Commit only, do not push
No VERSION file? No problem — versioning is skipped entirely. Flags can be combined: /auto-commit --minor --no-push.
| Type | Description | Version Bump |
|---|---|---|
feat |
New feature or capability | minor |
fix |
Bug fix | patch |
refactor |
Code restructuring | patch |
docs |
Documentation only | patch |
style |
Formatting, whitespace | patch |
test |
Adding or updating tests | patch |
chore |
Build, CI, dependencies | patch |
perf |
Performance improvement | patch |
rm ~/.claude/commands/auto-commit.mdOr use the uninstall script:
./uninstall.shContributions are welcome! Please open an issue or submit a pull request.