claude-code - 💡(How to fix) Fix [BUG] commit-commands:commit plugin loads full git diff into context — causes context bloat on large commits

Official PRs (…)
ON THIS PAGE

Recommended Tools

×6

Utilities matched from this issue’s tags and category — try them while you read without losing context.

GitHub issue graph ai analysis

Paste a GitHub issue URL. We fetch that issue, discover linked issues from bodies/comments/timeline, collect linked pull requests, and produce a structured English report.

The report is written in English Markdown for sharing and archival.

Helpful · Quick feedback

Loading…

Error Message

Error Messages/Logs

Code Example

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

Preflight Checklist

  • I have searched existing issues and this hasn't been reported yet
  • This is a single bug report (please file separate reports for different bugs)
  • 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.

Vote matrix · Quick signals

Works
Did the solution work? Tap to confirm.
Easy Fix
Was it a quick fix?
Time Saver
Did it save you time?
Blocking
Was it severely blocking?
Common Issue
Are others likely hitting this too?
Flaky / Intermittent
Is it intermittent?
Verified / Reproducible
Can you reproduce it reliably?
Loading…

Still need to ship something?

×6

Another batch ranked right after the header list — different links, same matching logic.

Back to top recommendations

TRENDING