pr-fix

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

Install

Getting it into your agent

One page per mod, every tool's command on it. A separate URL per tool would split the same page into five that compete with each other.

agentmods
npx agentmods add commands/sanmak/specops/pr-fix
Clone the repo
git clone --depth 1 https://github.com/sanmak/specops

Made for: Claude Code.

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. Scan, not verified.
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 $0.00000 $0.08595
Opus 5 $0.00000 $0.04297
Sonnet 5 $0.00000 $0.01719
Haiku 4.5 $0.00000 $0.00860

Measured 2d ago against content hash 79e301639cb2, method: parsed. Prices are Anthropic first-party input rates as of 2026-08-30, 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 2d 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. 2d 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 1mo 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.