A bash function that automatically generates meaningful git commit messages using Claude AI by analyzing staged changes. The function stages all changes, sends a truncated diff to Claude with a prompt for a single-line commit message, and commits with the generated message. It includes a spinner animation for visual feedback during generation and allows manual message override when needed. The solution transforms generic "wip" commits into descriptive messages that help teammates understand code changes.

5m read timeFrom freek.dev
Post cover image
Table of contents
My commit functionWhat are dotfiles anyway?How the AI generation worksStill fast, still flexibleAdding a spinner for nicer outputIn closing

Sort: