Claude Auto-Commit is an open-source tool that automatically generates intelligent Git commit messages by analyzing your code changes using Claude Code SDK. It integrates seamlessly into your development workflow with enhanced performance, reliability, and modern JavaScript architecture.
Say goodbye to vague commit messages. Let Claude AI write meaningful commits that tell the story of your code.
- Requires Claude Pro/Max subscription and Claude CLI authentication
- No API key needed - uses Claude Code SDK with OAuth authentication
- Run
claude login
first if not already authenticated - By default, this tool will automatically stage all changes and commit
- Use
--push
flag to enable auto-push to remote repository - Use
--dry-run
flag to preview commit messages without committing
Method 1: NPX execution (recommended, no installation needed)
npx claude-auto-commit
Method 2: NPM global installation
npm install -g claude-auto-commit
Method 3: Script installation
curl -fsSL https://raw.githubusercontent.com/0xkaz/claude-auto-commit/main/scripts/install.sh | bash
Method 4: One-time script execution
curl -fsSL https://raw.githubusercontent.com/0xkaz/claude-auto-commit/main/scripts/run-once.sh | bash
# Analyze changes and generate commit message
npx claude-auto-commit
# Japanese with emojis and conventional commits
npx claude-auto-commit -l ja -e -c
# Custom commit type with auto-push
npx claude-auto-commit -t feat --push
Claude Auto-Commit uses Claude Code SDK which requires Claude Pro or Max subscription:
# First-time setup: Login to Claude CLI
claude login
# Choose option: "2. Claude app (requires Max subscription)"
# This opens your browser for OAuth authentication
# No API key needed - authentication is handled automatically
After initial login, your authentication is saved and claude-auto-commit will work seamlessly.
- π§ AI Analysis: Leverages Claude Code SDK for intelligent code change understanding
- π Multi-language: Interface available in English and Japanese
- π Conventional Commits: Optional support for conventional commit format
- π Emoji Support: Add contextual emojis to commit messages
- π Dry Run Mode: Preview commit messages without making actual commits
- π Template System: Save and reuse common commit message patterns
- βοΈ Configuration: JSON-based configuration file support
- π Retry Mechanism: Enhanced error handling with exponential backoff
- β‘ Performance: Parallel processing and intelligent caching
- π Auto-push: Optional automatic push to remote repository
- π Verbose Logging: Detailed execution metrics and statistics
- π οΈ Configurable: Extensive customization through CLI options and config files
- π¦ Modern Architecture: Node.js ES modules with TypeScript support
Complete documentation available in this repository.
- Node.js 22.0.0 or later
- Git repository
- ANTHROPIC_API_KEY environment variable
You need a Claude account with API access:
- Claude Pro ($20/month) - Small repositories
- Claude Max ($100/month) - Regular development
- Claude Max ($200/month) - Large projects/teams
Set your API key:
export ANTHROPIC_API_KEY="your-api-key"
The tool automatically installs:
- Claude Code SDK (
@anthropic-ai/claude-code
) - Required Node.js dependencies
# Simple commit with auto-generated message (will auto-stage, commit, and push)
claude-auto-commit
# Commit without auto-push (recommended for beginners)
claude-auto-commit -n
# Skip push confirmation prompt
claude-auto-commit -y
# Generate message without committing (dry-run)
claude-auto-commit --dry-run
# Show detailed change summary
claude-auto-commit --summary
# Manual file selection without auto-push
claude-auto-commit -s -n
# Custom branch and emoji
claude-auto-commit -b develop -e
# English with conventional commits
claude-auto-commit -l en -c -t feat
# Custom message, no push
claude-auto-commit -m "Custom commit message" -n
# Manual staging with verbose output
claude-auto-commit -s -v
# Custom prefix for hotfix
claude-auto-commit -p "[HOTFIX]" -t fix
# Preview message without committing
claude-auto-commit --dry-run
# Show detailed change statistics
claude-auto-commit --summary
# Combine options for detailed preview
claude-auto-commit --dry-run --summary -v
# Template management
claude-auto-commit --save-template hotfix "π₯ HOTFIX: {description}"
claude-auto-commit --template hotfix
claude-auto-commit --list-templates
# Update tool
claude-auto-commit --update
curl -fsSL https://raw.githubusercontent.com/0xkaz/claude-auto-commit/main/scripts/install.sh | bash
# Download the latest release
curl -L -o claude-auto-commit https://github.com/0xkaz/claude-auto-commit/releases/latest/download/claude-auto-commit.sh
chmod +x claude-auto-commit
sudo mv claude-auto-commit /usr/local/bin/
git clone https://github.com/0xkaz/claude-auto-commit.git
cd claude-auto-commit
chmod +x src/claude-auto-commit.sh
sudo ln -s $(pwd)/src/claude-auto-commit.sh /usr/local/bin/claude-auto-commit
# For development or testing
git clone https://github.com/0xkaz/claude-auto-commit.git
cd claude-auto-commit
./src/claude-auto-commit.sh [options]
Create ~/.claude-auto-commit/config.yml
:
auto_update:
enabled: true
frequency: daily # daily/weekly/manual/always
silent: false
defaults:
language: en
branch: main
emoji: false
conventional: false
git:
auto_stage: true
auto_push: true
- Claude Code SDK Migration: Migrated from Claude CLI to modern Claude Code SDK
- Enhanced performance with parallel processing and intelligent caching
- Exponential backoff retry mechanism for improved reliability
- Template system with persistent storage
- JSON configuration file support
- NPM Package Distribution: Available via
npx claude-auto-commit
- OAuth Authentication: No API key required for Claude Pro/Max users
- ES Modules Architecture: Modern JavaScript with Node.js 22+ support
- Smart placeholders: Use
{variable}
in templates for dynamic values
Contributions are welcome! Please read CONTRIBUTING.md for details.
This project is licensed under the MIT License - see the LICENSE file for details.
- Anthropic for Claude CLI
- Conventional Commits specification
- Open source community for inspiration
Made with β€οΈ for the developer community