Bug: /pr skill uses invalid --stat flag with gh pr diff

Resolved 💬 2 comments Opened Feb 1, 2026 by iheitlager Closed Mar 1, 2026

Description

The built-in /pr skill is using gh pr diff <number> --stat, but the --stat flag does not exist for the gh pr diff command.

Steps to Reproduce

  1. Run /pr command (or invoke the pr skill)
  2. The skill attempts to run gh pr diff 90 --stat
  3. Command fails with error

Expected Behavior

The command should use a valid flag. Possible alternatives:

  • gh pr diff <number> --name-only - shows only changed filenames
  • Use git diff --stat after checking out the PR branch
  • Use gh pr view <number> --json files to get file information

Actual Behavior

Command fails because --stat is not a recognized flag for gh pr diff.

Valid gh pr diff Flags

According to gh pr diff --help, the available flags are:

  • --name-only - Display only names of changed files
  • --patch - Display diff in patch format
  • --web - Open in browser
  • --color - Color output

Environment

  • Claude Code version: 2.1.27
  • OS: macOS (Darwin 24.6.0)
  • gh version: $(gh --version | head -1)

Suggested Fix

Replace gh pr diff --stat with either:

  1. gh pr diff --name-only (closest equivalent)
  2. Or checkout the PR and use git diff --stat

View original on GitHub ↗

This issue has 2 comments on GitHub. Read the full discussion on GitHub ↗