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.
curl -O https://raw.githubusercontent.com/sanmak/specops/main/.claude/commands/pr-fix.mdgit clone --depth 1 https://github.com/sanmak/specopsWrote 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.
[](https://agentmods.dev/commands/sanmak/specops/pr-fix)<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.
<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>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.
| Model | Per session | Once 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 |
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.
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):
$ARGUMENTSis a PR number (e.g.,3) or empty. - Watch mode:
$ARGUMENTSstarts withwatchfollowed by a PR number (e.g.,watch 3). - All mode:
$ARGUMENTSstarts withall, optionally followed by--dry-runand/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.
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.
- 1mo ago First seen · 664 lines · 0 tokens per session scan A 79e301639cb2
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.
Other commands, from other repositories
skill-creator
Create or update an OpenCode skill using the bundled skill-creator workflow.
skill-registry
Rebuild the OpenCode skill registry for the current project and installed skills.
pr-package
Prepare a GitHub PR delivery package (branch, commits, PR title and body, reviewer notes) from the real git diff against an explicit base branch, persisted as PRPACKAGE.md, never inventing work outside the diff. Use when scope is done and diff is stable. Do not use mid-implementation, for a branch name (use…
prp-commit
Quick commit with natural language file targeting: describe what to commit in plain English.
address-pr-feedback
Systematically address PR review comments. Fetches all threads, categorizes by status (acknowledged, silently fixed, unaddressed), and guides user through posting replies and implementing fixes with explicit approval.
branch-commit
Return a branch name and concise commit message (max 3 lines) for the current task, grounded in the real git diff; with --apply, create the commit after showing the staged diff. Use when the user only needs quick branch and commit naming before committing, PR packaging is unnecessary, and a real diff exists; use…