
My git workflow with Claude Code (keeping history clean)
When Claude Code is doing most of the implementation, git history gets messy fast. You end up with commits like "fix the thing", "actually fix the thing", "revert fix and try different approach". Here's the workflow I settled on. Work on branches, always Never let Claude commit directly to main. This is more important with AI-assisted development because Claude will confidently make changes that seem reasonable but need review. git checkout -b feature/[what-we 're-building] Tell Claude the commit message style before starting Add to your CLAUDE.md: When committing: use conventional commits format. feat: for new features fix: for bug fixes refactor: for refactoring test: for test-only changes Keep subjects under 72 chars. No period at end. Without this, Claude writes commit messages that are paragraphs. Atomic commits Claude's default is to batch everything into one commit. Prompt: "Commit each logical change separately. If you're changing the data model and updating the UI, those are t
Continue reading on Dev.to Webdev
Opens in a new tab



