claude-code icon indicating copy to clipboard operation
claude-code copied to clipboard

[BUG]

Open jnardiello opened this issue 5 months ago • 4 comments

Environment

  • Platform (select one):
    • [ ] Anthropic API
    • [ ] AWS Bedrock
    • [ ] Google Vertex AI
    • [ x] Other: Claude Code
  • Claude CLI version: 1.0.70
  • Operating System: macOS 15.5
  • Terminal: Ghostty

Bug Description

When trying to run /security-review I'm getting this error:

> /security-review
  ⎿  Error: Bash command failed for pattern "!`git diff --merge-base origin/HEAD`": [stderr]
     usage: git diff [<options>] [<commit> [<commit>]] [--] [<path>...]

> why isn't security-review working?

⏺ The security-review command has a bug in its implementation. It's trying to use:
  git diff --merge-base origin/HEAD

  But --merge-base is not a valid option for git diff. The correct git commands would be:

  1. git diff origin/HEAD...HEAD (three dots for changes on current branch)
  2. git diff $(git merge-base origin/HEAD HEAD)..HEAD (using merge-base separately)

  This is a bug in the Claude Code security-review command itself. You should report this issue at https://github.com/anthropics/claude-code/issues

  As a workaround, I can manually review your changes for security concerns:

Steps to Reproduce

  1. Open Claude Code in CLI
  2. type /security-review

Expected Behavior

It should run a security review

Actual Behavior

Getting this error:

Error: Bash command failed for pattern "!`git diff --merge-base origin/HEAD`": [stderr]
     usage: git diff [<options>] [<commit> [<commit>]] [--] [<path>...]

jnardiello avatar Aug 07 '25 18:08 jnardiello

I have the same problem。

git version 2.47.0.windows.2 windows11

FYeahnyx avatar Aug 11 '25 03:08 FYeahnyx

Same issue for me. Claude Code on WSL2.

  • Git 2.25.1
  • Claude-CLI: 1.0.77

politan avatar Aug 13 '25 15:08 politan

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.

github-actions[bot] avatar Dec 11 '25 10:12 github-actions[bot]