[BUG] commit-commands:commit plugin loads full git diff into context — causes context bloat on large commits

Resolved 💬 1 comment Opened May 12, 2026 by daniel769 Closed Jun 12, 2026

Preflight Checklist

  • [x] I have searched existing issues and this hasn't been reported yet
  • [x] This is a single bug report (please file separate reports for different bugs)
  • [x] I am using the latest version of Claude Code

What's Wrong?

The commit-commands:commit plugin reads the full unified diff into the prompt context on every invocation:

!git diff HEAD

For commits that include many auto-generated files, this produces a very large tool result output in a single turn, significantly bloating the context window and slowing all subsequent LLM responses in the
session.

What Should Happen?

Use git diff HEAD --stat instead. The stat summary (file names + insertion/deletion counts) is sufficient for generating a commit message without loading full file contents into context.

If full diff is ever needed for a specific file, the agent can fetch it on demand with a targeted git diff HEAD -- <file>.

Error Messages/Logs

# ~/.claude/plugins/marketplaces/claude-plugins-official/plugins/commit-commands/commands/commit.md line 9:
  - Current git diff (staged and unstaged changes): !`git diff HEAD`

Steps to Reproduce

  1. Install the commit-commands plugin
  2. Make a commit that touches 50+ large auto-generated text files
  3. Run commit-commands:commit
  4. Observe the tool result — the full unified diff of all files is loaded into context

Claude Model

Sonnet (default)

Is this a regression?

No, this never worked

Last Working Version

_No response_

Claude Code Version

2.1.126 (Claude Code)

Platform

Anthropic API

Operating System

macOS

Terminal/Shell

iTerm2

Additional Information

Suggested fix in commands/commit.md line 9:
Before: !git diff HEAD
After: !git diff HEAD --stat

The same issue exists in the create-pr command (uses git diff main...HEAD without --stat), but that is a separate report.

View original on GitHub ↗

This issue has 1 comment on GitHub. Read the full discussion on GitHub ↗