Show HN: Claude Auto-Commit – AI-powered Git commit message generation
## Background
Like many developers, I found myself typing "fix", "update", or "wip" more often than meaningful commit messages. After calculating I spend ~10 minutes/day on this (60 hours annually), I built a solution.
## What it does
Claude Auto-Commit analyzes staged Git changes and generates contextual commit messages using Claude's AI. It understands code structure and change patterns to create conventional-commit-style messages.
*Example:* ```bash git add . npx claude-auto-commit
# Output: feat(auth): Add JWT token validation middleware - Implement token verification for protected routes - Add error handling for expired tokens ```
## Technical approach
v0.1.4 is a complete rewrite from Bash to Node.js ES modules using Claude Code SDK.
*Key decisions:* 1. *Claude Code SDK*: More stable API, OAuth authentication 2. *Parallel processing*: Diff analysis + history parsing run concurrently 3. *Intelligent caching*: Reduces API calls ~50% 4. *Template system*: `{description}` placeholders for team consistency
*Core logic:* ```javascript const [diffAnalysis, context] = await Promise.all([ analyzeDiff(gitDiff), getProjectContext() ]); const message = await claudeSDK.generateMessage( buildContextualPrompt(diffAnalysis, context) ); ```
## Performance - *Cold start*: ~1.5s (includes auth) - *Cached*: ~0.8s - *Memory*: <50MB peak
## What I learned
*Works well:* - File type analysis beats raw diffs for context - Caching similar changes improves UX dramatically - Templates help teams without being rigid
*Challenges:* - Large diffs (>500 lines) need summarization - Projects have vastly different commit styles - Balancing AI creativity with conventional standards
## Limitations - Requires Claude Pro/Team subscription - Works best with <500 line changes - Basic template system (planning smarter pattern recognition)
## Tech stack - *Runtime*: Node.js 18+ ES modules - *AI*: Claude Code SDK (OAuth) - *Distribution*: npm + curl installer - *Config*: JSON with sensible defaults
Core insight: treating this as context-aware summarization, not template filling.
## Future plans - VS Code extension - GitHub Actions integration for PR descriptions - Team analytics (which styles correlate with better reviews)
## Try it ```bash npx claude-auto-commit ```
*GitHub*: https://github.com/0xkaz/claude-auto-commit *Website*: https://claude-auto-commit.0xkaz.com
Feedback welcome, especially from teams struggling with commit consistency. Free and open source.
Requires Claude subscription, but exploring accessibility options.
No comments yet