Feature request: Configurable auto-commit at natural breakpoints

Resolved 💬 3 comments Opened Feb 14, 2026 by camboaidev Closed Feb 17, 2026

Problem

During long Claude Code sessions, commits happen infrequently because they require explicit user instruction. This creates two risks:

  1. Data loss — uncommitted work can be lost if a destructive operation occurs (accidental git checkout, context compaction losing track of changes, etc.)
  2. Large, hard-to-review changesets — when commits finally happen, they bundle many unrelated changes

There's no way to configure Claude Code to automatically commit at safe moments.

Proposed Solution

Allow users to configure auto-commit behavior via settings:

{
  "autoCommit": {
    "enabled": true,
    "trigger": "task_complete",
    "strategy": "grouped"
  }
}

Possible triggers

  • task_complete — auto-commit after a logical unit of work is done (feature implemented, bug fixed)
  • pre_compaction — auto-commit before context compaction to create a safe restore point
  • interval — commit every N completed tool call chains
  • pre_destructive — auto-stash/commit before any destructive git operation

Strategy options

  • single — one commit with all changes
  • grouped — group files by domain/theme into separate commits (like conventional commit workflows)

Why This Matters

Power users running long multi-task sessions (2+ hours) accumulate significant uncommitted work. An auto-commit safety net — especially before compaction or destructive operations — would prevent the most painful data loss scenarios without requiring the user to manually interrupt their workflow to say "commit".

View original on GitHub ↗

This issue has 3 comments on GitHub. Read the full discussion on GitHub ↗