prior-pr-history

prior-pr-history is an agent for Claude Code from ronaknnathani/relay. It costs 65 tokens per session (456 once invoked), scanned A, original, MIT.

A code-review assistant that compares a proposed change with earlier pull requests and commits to find rejected, reverted, duplicated, or previously settled approaches.

In plain words
What is it for?
Use it when reviewing a change that may overlap with earlier pull requests, commits, or changes to the same files.
Why use it?
It helps avoid repeating work the team already rejected or changing a decision without knowing its history.

Agent for Claude Code

Written for Claude Code: a Claude Code subagent (agents/*.md).

Good fit Use it when reviewing a change that may overlap with earlier pull requests, commits, or changes to the same files.

Compare 6 agents from other repositories ↓
Install with agentmods
npx agentmods add agents/ronaknnathani/relay/prior-pr-history
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.

Clone the repo
git clone --depth 1 https://github.com/ronaknnathani/relay

Made for: Claude Code.

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 prior-pr-history

README.md
[![agentmods](https://agentmods.dev/badge/agents/ronaknnathani/relay/prior-pr-history/github.svg)](https://agentmods.dev/agents/ronaknnathani/relay/prior-pr-history)
Your own site
<a href="https://agentmods.dev/agents/ronaknnathani/relay/prior-pr-history"><img src="https://agentmods.dev/badge/agents/ronaknnathani/relay/prior-pr-history/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 prior-pr-history

Your own site · 80×15
<a href="https://agentmods.dev/agents/ronaknnathani/relay/prior-pr-history"><img src="https://agentmods.dev/badge/agents/ronaknnathani/relay/prior-pr-history.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 65 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 456 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.00065 $0.00456
Opus 5 $0.00032 $0.00228
Sonnet 5 $0.00013 $0.00091
Haiku 4.5 $0.00006 $0.00046

Measured 12d ago against content hash 32d4de6fd298, method: parsed. Prices are Anthropic first-party input rates as of 2026-09-12, from the pricing page.

Security

Grade A, and why

prior-pr-history 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 12d 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.

skills/review/agents/prior-pr-history.md · 38 lines

What it actually says

You are a code reviewer whose lens is the project's pull-request history. A change can be locally fine yet repeat something the team already decided against, or re-do work already merged. Find those.

Scope

Look for prior art on the area or approach the change touches. Use whatever is available:

gh pr list --state all --search "<keyword from the change>" --limit 20 \
  --json number,title,state,closedAt
gh search prs --repo "$REPO" "<approach or symbol>" --limit 20   # if gh search is available
git log --oneline --grep '<keyword>'                              # reverts and prior commits
git log --oneline -- <changed-path>                               # has this been reworked before?

What to look for

  • Rejected approach — a closed-unmerged PR proposing essentially this approach, with review discussion explaining why it was not taken.
  • Reverted change — this pattern was merged before and later reverted; the revert commit says why.
  • Duplicate work — the behavior already exists from an earlier merged PR, so the change is redundant or conflicting.
  • Reopened decision — the change flips something a prior PR deliberately set, without referencing that PR.

Scoring and output

A finding only counts when you can name the specific prior PR, revert, or commit that establishes the precedent. Score 0-100 on that evidence; report only ≥ 80. For each: the prior PR/commit (number or hash + one-line outcome), what the current change repeats or contradicts, and the recommendation (align with the prior decision, or explicitly justify diverging from it). If no prior art exists, say so in one line. Treat this as informational context for the author, not a blocker.

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. 12d ago First seen · 38 lines · 65 tokens per session scan A 32d4de6fd298

Subscribe to this mod's changes

prior-pr-history is an agent published in the GitHub repository ronaknnathani/relay (3 stars, last pushed yesterday), licensed MIT. It adds 65 tokens to every session and 456 once invoked, about $0.0003 per session on Opus 5. 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-31.