specops: Command for Claude Code

.claude/commands/pr-fix.md

pr-fix is a command for Claude Code from sanmak/specops. It costs 0 tokens per session (8,595 once invoked), scanned A, original, MIT.

A command for handling review comments on a GitHub pull request, a proposed set of code changes, from an isolated Git worktree.

In plain words
What is it for?
Use it to fetch inline comments, fix one pull request or all open pull requests, push the fixes, or watch a pull request for new feedback.
Why use it?
It groups requested changes and applies them in a controlled copy, so fixing review feedback does not disrupt your main working directory.

Command for Claude Code

Written for Claude Code: $ARGUMENTS substitution. Also seen: mentions .claude-plugin; mentions Codex.

This is sanmak/specops's own configuration. It tells Claude Code how to work on specops itself, so it is not a mod to install elsewhere. Copy it as a starting point and replace the rules that are about this project. Everything specops configures →

Part of the specops plugin — 2 skills, 14 commands shipped together

Reuse

Borrowing it

Nothing to install: this file belongs to sanmak/specops. Take a copy, put it at the same path in your own repository, and replace the rules that are about this project with yours.

Copy the file
curl -O https://raw.githubusercontent.com/sanmak/specops/main/.claude/commands/pr-fix.md
Clone the repo
git clone --depth 1 https://github.com/sanmak/specops

Made for: Claude Code.

Or install specops, the plugin that ships this one along with the rest of its 2 skills, 14 commands.

Wrote this? Show the measurements

A badge with what this costs and how it scanned, read live from this page, so it follows the numbers instead of freezing them. Markdown for a README, HTML for a documentation site or a project page.

agentmods badge for pr-fix

README.md
[![agentmods](https://agentmods.dev/badge/commands/sanmak/specops/pr-fix/github.svg)](https://agentmods.dev/commands/sanmak/specops/pr-fix)
Your own site
<a href="https://agentmods.dev/commands/sanmak/specops/pr-fix"><img src="https://agentmods.dev/badge/commands/sanmak/specops/pr-fix/github.svg" alt="Measured on agentmods" height="20"></a>

Or the 80×15 button, for a site that already has a row of RSS and ATOM ones. Only the verdict fits; the numbers stay here.

agentmods 80×15 button for pr-fix

Your own site · 80×15
<a href="https://agentmods.dev/commands/sanmak/specops/pr-fix"><img src="https://agentmods.dev/badge/commands/sanmak/specops/pr-fix.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 0 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 8,595 The whole file, excluding the scripts and references it only reads on demand.
Security scan A 0 findings. A grade says what 26 rules found in the file — not that it is safe.
Origin original No closer match found in the catalogue.
Token cost

What it costs to keep this loaded

Counted locally with the o200k_base tokenizer, which is exact for GPT models; Claude uses its own tokenizer and its counts differ. Treat this as one consistent yardstick across the catalogue rather than a bill. Prices are per million input tokens.

ModelPer sessionOnce invoked
Fable 5.1 $0.00000 $0.08595
Opus 5.5 $0.00000 $0.03438
Sonnet 5.5 $0.00000 $0.01719
Haiku 4.5 $0.00000 $0.00860

Measured 1mo ago against content hash 79e301639cb2, method: parsed. Prices are Anthropic first-party input rates as of 2026-10-07, from the pricing page.

Security

Grade A, and why

pr-fix scanned grade A with 0 findings against 26 rules in 11 categories — prompt injection, anti-refusal, data exfiltration, privilege escalation, supply chain, agent snooping, system-prompt leakage, SSRF and excessive agency — measured 1mo ago.

A static scan of the body, not an audit. Every finding is printed with the line that produced it so you can judge whether it matters here. A mod is markdown that instructs an agent; that is exactly why what it instructs is worth reading.

Nothing flagged

None of the 26 patterns this scan looks for appear in this file: no shell pipes, no recursive deletes, no credential paths, no hidden text, no instruction-override or anti-refusal phrasing, no agent-config snooping. That is not a guarantee, it is the absence of the things that are checkable.

.claude/commands/pr-fix.md · 664 lines

How it starts

The opening of the file, as written. The whole thing — 664 lines — stays where its author put it; the contents beside it link to each section on GitHub.

Fetch inline review comments from a GitHub PR, group by issue type, apply fixes, and push — all in an isolated git worktree. Supports watch submode for PR babysitting and all submode to fix every open PR with review comments.

Instructions

Follow these steps precisely. Do NOT add a Co-Authored-By line to commits.

Argument Parsing

Compact-state recovery pre-check: After detecting mode and PR target below, check for a matching compact state file. For fix mode, check .claude/.pr-fix-compact-state-<PR_NUMBER>.json. For all mode, check .claude/.pr-fix-compact-state-all.json. If the file exists and its saved mode and pr_number (or pr_list) match the current invocation, restore all state variables from the file and skip any already-completed steps. The compact state file is deleted at the end of a successful run (see Step 9 / Step A6).

Parse $ARGUMENTS for one of three modes:

Global flag — --minor: If --minor is present anywhere in $ARGUMENTS, set INCLUDE_MINOR = true and strip it before further parsing. Default: INCLUDE_MINOR = false. When false, CodeRabbit comments with _🟡 Minor_ severity are filtered out in Step 4a. When true, all severities are processed.

Parse the remaining $ARGUMENTS for one of three modes:

  • Fix mode (default): $ARGUMENTS is a PR number (e.g., 3) or empty.
  • Watch mode: $ARGUMENTS starts with watch followed by a PR number (e.g., watch 3).
  • All mode: $ARGUMENTS starts with all, optionally followed by --dry-run and/or a number limit (e.g., all, all --dry-run, all 3, all --dry-run 3).

All modes support --minor (e.g., /pr-fix 3 --minor, /pr-fix watch 3 --minor, /pr-fix all --minor --dry-run 3).

If watch mode is detected, skip to the Watch Mode section below. If all mode is detected, skip to the All Mode section below.

For fix mode, extract the PR number from $ARGUMENTS. If empty, try auto-detection: gh pr view --json number -q .number 2>/dev/null. If auto-detection fails, ask the user "Which PR number should I fix?" and wait for their response.

Read the full file on GitHub · 664 lines

Changes

What this file has done since we first saw it

Hashed on every crawl. A supply-chain change to an agent config is a question of when, not whether, so the history is kept rather than the latest state alone.

  1. 1mo ago First seen · 664 lines · 0 tokens per session scan A 79e301639cb2

Subscribe to this mod's changes

pr-fix is a command published in the GitHub repository sanmak/specops (49 stars, last pushed 2mo ago), licensed MIT. It costs nothing until one of its globs matches a file; then it loads 8,595 tokens. A static security scan graded it A with 0 findings. No closer match exists in the catalogue, so it is treated as the original; first seen 2026-08-30.