Skip to content

Instantly share code, notes, and snippets.

@amcclosky
Created December 8, 2025 17:30
Show Gist options
  • Select an option

  • Save amcclosky/b42a24318c3bd7fdd3a094ff3b44ac36 to your computer and use it in GitHub Desktop.

Select an option

Save amcclosky/b42a24318c3bd7fdd3a094ff3b44ac36 to your computer and use it in GitHub Desktop.
Claude Commit Command: `/commit ` - .claude/commands/commit.md
description allowed-tools
Commit pending changes with context-aware messages based on conversation
Bash(git status:*), Bash(git diff:*), Bash(git add:*), Bash(git commit:*), Bash(git log:*)

Commit all pending changes on this branch. Follow these steps:

  1. Run git status and git diff to see all pending changes (staged and unstaged)

  2. Analyze the changes and determine if they should be a single commit or split into multiple commits. Split into multiple commits when:

    • Changes affect unrelated features or areas of the codebase
    • There are distinct logical units of work (e.g., a refactor + a new feature)
    • Separating would make the git history clearer and more useful
  3. For each commit, write a message with this format:

    • Line 1: Brief one-sentence summary (50 chars or less if possible, max 72)
    • Line 2: Blank
    • Lines 3+: Detailed description explaining:
      • What specifically changed
      • Why these changes were made (use context from our conversation)
      • Any relevant context that would help someone reviewing later understand the reasoning
  4. Stage the appropriate files and create each commit

Use the conversation history to understand the intent and context behind the changes. The detailed description should capture the "why" - not just what changed, but the reasoning and goals behind the changes.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment