Claude Code ships four commands that integrate directly with your git workflow. Each one runs inside the REPL and uses the GitHub CLI (Documentation Index
Fetch the complete documentation index at: https://mintlify.com/instructkr/claude-code/llms.txt
Use this file to discover all available pages before exploring further.
gh) or standard git commands under the hood.
/commit
Generates and creates a git commit for your current changes. When you run/commit, Claude Code:
- Reads the current
git status,git diff HEAD, branch name, and recent commit history. - Drafts a concise commit message that follows the repository’s existing style.
- Stages relevant files and creates the commit using a HEREDOC to avoid shell-quoting issues.
/commit never amends existing commits, skips hooks, or commits files that look like they contain secrets (.env, credentials.json, etc.). If no changes are staged or unstaged, it will not create an empty commit.git add, git status, and git commit. No other tools are invoked during commit creation.
| Operation | Purpose |
|---|---|
git add | Stage files before committing |
git status | Read which files have changed |
git commit | Create the commit |
/review
Reviews a GitHub pull request and provides structured feedback. Without arguments,/review runs gh pr list to show open PRs and asks you to select one. If you pass a PR number, it fetches that PR directly.
gh pr view <number> and the full diff with gh pr diff <number>, then produces a review covering:
- An overview of what the PR does
- Code quality and style analysis
- Specific suggestions for improvement
- Potential issues or risks
- Test coverage and security considerations
/review requires the GitHub CLI (gh) to be installed and authenticated. Run gh auth status to verify./ultrareview command is available on supported accounts. It runs a deeper, automated bug-hunting analysis (10–20 minutes) via Claude Code on the web, rather than locally. It is only shown when your account has access.
/diff
Opens an interactive diff viewer showing uncommitted changes and per-turn diffs within the current conversation.- Uncommitted changes — the current working tree diff against
HEAD - Per-turn diffs — what files changed during each turn of the current conversation
q or Escape to close the viewer and return to the REPL.
/pr_comments
Fetches and displays comments from the current GitHub pull request, including both PR-level comments and inline code review comments.- Runs
gh pr view --json number,headRepositoryto find the current PR and repo. - Calls the GitHub API for PR-level comments (
/issues/{number}/comments). - Calls the GitHub API for inline code review comments (
/pulls/{number}/comments). - Formats the output with author, file path, line number, diff hunk context, and comment body.
This should throw rather than return null — callers don’t check the return value.