All articles

Commit Early, Commit Often with Claude

Git is your safety net when working with Claude, and small, frequent commits make that net much stronger. Each commit is a checkpoint you can return to. When a change goes wrong, you roll back to the last good state instead of trying to hand-untangle a pile of edits.

The rhythm fits the Explore, Plan, Implement, Commit loop: once a verifiable step passes its check, commit it. Then move on. Each commit captures one working change.

Claude can handle the git work for you. Ask it plainly:

Commit this with a message describing the validation change.

Or have it commit at the end of each step in a larger task, so your history mirrors the steps you broke the work into.

Why small commits pay off here:

  • Easy rollback. If Claude's next change breaks something, git reset or git revert to the last commit gets you back instantly.
  • Reviewable history. One change per commit is far easier to read later than a single commit holding a day's work.
  • A clear record. You can see exactly what each step changed, which helps when you or a teammate revisits it.

A couple of habits keep this smooth. Check the state yourself before committing with bash mode:

!git status
!git diff

Then you know precisely what is about to be recorded. And commit only when you are ready; let each change earn its checkpoint by passing its check first.

Think of commits as the verified milestones of your session. Break the work into steps, give each step a check to pass, and commit once it does. Do that, and a wrong turn is never expensive, because a known-good state is always one command away.

Comments

Be the first to comment.