Files
dotfiles/home/dot_claude/commands/amend-commit.md
Xevion 17b1be33a9 feat: add commit-helper tool to optimize AI commit context
Replaces verbose git command invocations in commit commands with a smart
TypeScript helper that:
- Filters out lockfiles, binary files, and generated content from diffs
- Truncates large diffs intelligently by preserving complete file changes
- Provides structured summaries with file type distribution and change stats
- Shows previews of new files being added

Also adds Fish shell VSCode extension and enables Claude Code panel preference.
2025-12-27 17:01:31 -06:00

1.2 KiB

allowed-tools, description
allowed-tools description
Bash(git commit:*) Amend the most recent commit (with staged changes and/or message reword)

Context

!commit-helper --amend

Your task

Amend the most recent commit using git commit --amend -m "your new message".

CRITICAL: You MUST write a new commit message. DO NOT use --no-edit.

Process:

  1. Analyze what files are changing:

    • If staged changes exist: combined old commit files + new staged files
    • If no staged changes: just the files from the original commit
  2. Write an appropriate commit message that describes ALL the changes (both original and newly staged)

    • Follow the commit style from recent history
    • Scale complexity to the changes (simple renames = short message, complex features = detailed message)
  3. Execute: git commit --amend -m "your new message"

Important:

  • NEVER use --no-edit - always write a fresh commit message
  • DO NOT fetch the old commit message - it's irrelevant
  • The message should describe what the commit does NOW (after amendment), not what it did before
  • If in plan mode, proceed anyway - command execution is implied
  • Use a single bash command: git commit --amend -m "message"
  • Do not stage additional files beyond what is already staged