[Bug] Claude Code passes invalid `--no-stat` flag to `git show` command
Status Open
Maintainer reply None cached
Workaround ✓ Mentioned in thread ↓
Activity 15 comments · opened Dec 4, 2025
Bug Description
In Claude Code 2.0.58, please know that Claude often tries git show with --no-stat, but there's no such option:
● Bash(git show HEAD --no-stat)
⎿ Error: Exit code 128
fatal: unrecognized argument: --no-stat
This can waste precious context.
Maybe this could be part of the system prompt or some tool config?
Just a suggestion.
Environment Info
- Platform: linux
- Terminal: kitty
- Version: 2.0.58
- Feedback ID: 83675796-99ee-4502-aeeb-cd20505f0696
Errors
[]
15 Comments
This issue has been inactive for 30 days. If the issue is still occurring, please comment to let us know. Otherwise, this issue will be automatically closed in 30 days for housekeeping purposes.
Still happening.
This is still happening today, in 2.1.15
Still active as of 2.1.19
Just happened to me today...
Version: 2.1.22
Model: opus (claude-opus-4-5-20251101)
<img width="375" height="297" alt="Image" src="https://github.com/user-attachments/assets/31450bfa-98be-4654-b3c7-8bf6875f378c" />
Happening on 2.1.25 as well (not sure about newer versions, I downgraded because of all the performance issues in 2.1.29).
FWIW including instructions in
CLAUDE.mddoesn't seem to help:Very annoying, should be a simple fix.
This continues to be an annoyance and waste of time. If this is a difficult fix, then explain why or just take care of it already.
As a workaround, you can use a PreToolUse hook to strip that flag from the command. Something like this:
@drmercer-lucid Did you vibe-code this? 😉
Absolutely 😄 I just wish Claude made it a little easier to vibe code hooks (it's surprisingly tedious to install and test them)
Hook workaround: strip
--no-statautomaticallyUntil this is fixed upstream, you can use a PreToolUse hook to silently rewrite
git show ... --no-statinto a valid command.git-show-flag-sanitizer.sh:Install in
.claude/settings.json:This intercepts every
Bashtool call, checks if it's agit showwith--no-stat, strips the invalid flag, and returns the corrected command viaupdatedInput. Other commands pass through untouched.The hook is also available as part of cc-safe-setup (tested with 10 test cases).
This still is happening now with 2,1,92 macos
Claude Code does this all the time, it exclusively does this. I've never seen it run a
git showwithout tryinggit show --no-statfirst and watching it fail.I still see this with v2.1.170.