Feature Request: Automatic Commit Message Generation from Staged or Unstaged Changes
Resolved 💬 4 comments Opened Jul 26, 2025 by PierrunoYT Closed Jan 7, 2026
Feature Request: Automatic Commit Message Generation from Staged or Unstaged Changes
Summary
Enable a /commit slash command in Claude Code that automatically generates a commit message based on the current changes in the git repository—whether staged or unstaged—without requiring manual copy-paste of diffs or summaries. The command should also allow optional user input as context.
Current Workflow Pain Point
To generate a commit message with Claude’s slash command, users must:
- Manually run
git diff --cached(for staged changes) orgit diff(for unstaged changes), - Copy the output,
- Paste it as an argument to
/commit.
This interrupts the development workflow and is repetitive.
Requested Feature
- New Capability:
Allow Claude Code to detect and use the most relevant changes automatically:
- If there are staged changes, use
git diff --cached. - If there are no staged changes but there are unstaged changes, use
git diff. - If there are no changes, prompt the user to provide context or input manually.
- Behavior:
- When typing
/commit(with no arguments), Claude fetches the appropriate diff and generates a commit message. - Allow
/commit [your message or summary]to override the diff with user input. - Security:
- Restrict access to only relevant diffs, with user consent as needed.
Benefits
- Saves time (no more manual copy-paste).
- Works seamlessly with either staged or unstaged changes.
- Makes commit message generation smoother and more intuitive.
- Reduces friction and errors, supports more workflows.
Similar Features
- GitHub Copilot Labs “commit message” feature
- VSCode “generate commit message” from changes
Optional Enhancements
- Allow choosing commit message style (Conventional, plain English, etc.).
- Optionally prompt the user to select which changes to include if both staged and unstaged are present.
---
Thank you for considering this improvement!
This issue has 4 comments on GitHub. Read the full discussion on GitHub ↗