AI-powered conventional commit message generator using Claude Haiku. Reads your staged diff → calls Claude → outputs a properly formatted commit message in seconds.
npx claude-ai-commitNo install required. Set ANTHROPIC_API_KEY and go.
npm install -g claude-ai-commit# Generate commit message from staged changes
claude-commit
# Include all unstaged changes too
claude-commit --all
# Force a specific commit type
claude-commit --type feat
# Generate AND auto-commit
claude-commit --commit
# Use a different Claude model
claude-commit --model claude-sonnet-4-6
# Dry run (no API call)
claude-commit --dry-runOutput example:
feat(auth): add OAuth2 PKCE flow for mobile clients
Automatically generate commit messages as you commit:
# .husky/prepare-commit-msg
npx claude-ai-commit --staged >> "$1"Or add to package.json:
{
"scripts": {
"prepare": "husky install"
}
}Spreads via dotfiles — every collaborator who clones your repo gets it too.
| Option | Default | Description |
|---|---|---|
--staged |
true |
Review staged diff only |
--all |
false |
Include all unstaged changes |
--type <type> |
auto | Force commit type (feat|fix|chore|docs|refactor|test|style|perf|ci) |
--commit |
false |
Auto-run git commit -m <message> |
--model |
claude-haiku-4-5-20251001 |
Claude model to use |
--dry-run |
false |
Print what would happen without calling Claude |
Environment variable: ANTHROPIC_API_KEY (required)
claude-pr-review — Claude-powered code review CLI for any git repo. Pair it with claude-commit for a complete AI-assisted git workflow.
If claude-commit saves you time, consider sponsoring on GitHub. Every dollar helps keep this maintained and free.
MIT