pr-monitor

pr-monitor is a command for Claude Code from Pierry/harness-kit. It costs 28 tokens per session (601 once invoked), scanned A, original, MIT.

A command that watches an open GitHub pull request, which is a proposed change awaiting review and merging. It checks repeatedly with increasingly longer delays until the request is merged or closed.

In plain words
What is it for?
Use it after creating a pull request to detect a merge, stop monitoring a closed request, and clear the related pipeline state when the merge completes.
Why use it?
It removes the need to keep checking the pull request yourself while the current coding session remains open.

Command for Claude Code

Written for Claude Code: installed under .claude/.

Part of the harness-kit plugin — 14 skills, 17 commands, 4 agents, 4 hooks shipped together

Good fit Use it after creating a pull request to detect a merge, stop monitoring a closed request, and clear the related pipeline state when the merge completes.

Compare 6 commands from other repositories ↓
Install with agentmods
npx agentmods add commands/pierry/harness-kit/pr-monitor
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/Pierry/harness-kit

Made for: Claude Code.

Or install harness-kit, the plugin that ships this one along with the rest of its 14 skills, 17 commands, 4 agents, 4 hooks.

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-monitor

README.md
[![agentmods](https://agentmods.dev/badge/commands/pierry/harness-kit/pr-monitor/github.svg)](https://agentmods.dev/commands/pierry/harness-kit/pr-monitor)
Your own site
<a href="https://agentmods.dev/commands/pierry/harness-kit/pr-monitor"><img src="https://agentmods.dev/badge/commands/pierry/harness-kit/pr-monitor/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-monitor

Your own site · 80×15
<a href="https://agentmods.dev/commands/pierry/harness-kit/pr-monitor"><img src="https://agentmods.dev/badge/commands/pierry/harness-kit/pr-monitor.svg" alt="Reviewed on agentmods" width="80" height="20"></a>
Per session 28 Only the description is in the session, so the agent can decide to use it. The body loads when it is invoked.
When invoked 601 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.00028 $0.00601
Opus 5 $0.00014 $0.00300
Sonnet 5 $0.00006 $0.00120
Haiku 4.5 $0.00003 $0.00060

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

Security

Grade A, and why

pr-monitor 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 11d 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/sse/pr-monitor.md · 57 lines

How it starts

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

Monitor active PR until it merges. Polls with backoff: 3min → 6min → 12min → 24min → 30min cap, escalating after 5 attempts at each rung.

Runs in active session via ScheduleWakeup. Closing session ends monitor.

Flow

  1. Read state from .claude/.pr-monitor-state.json.

    • Missing → first run. Detect PR from current branch:
      gh pr view --json number,url,headRefName,state
      
      No PR or state already MERGED → exit silently (nothing to watch). Otherwise initialize state:
      .claude/scripts/pr-monitor.py init <number> <url> <branch>
      
      Script prints next-delay in seconds.
    • Present → use state.pr_number.
  2. Check merge status:

    gh pr view <pr_number> --json state -q .state
    
  3. If MERGED:

    • Print one line: PR #<n> merged → <url>. Pipeline state cleared. Start next: /product-manager:run
    • Clear monitor state: .claude/scripts/pr-monitor.py clear
    • Clear pipeline state: .claude/scripts/pipeline.py clear
    • Do not call ScheduleWakeup. Done.
  4. If CLOSED (not merged):

    • Print: PR #<n> closed without merge. Monitor stopped.
    • Clear monitor state only. Done.
  5. If OPEN:

    • Bump attempt counter, get next interval:
      .claude/scripts/pr-monitor.py bump
      
      Script prints next-delay in seconds (e.g. 180, 360, 720, 1440, 1800).
    • Read state with .claude/scripts/pr-monitor.py read for current_interval_min and total_attempts to include in user-facing line.
    • Print one line: PR #<n> still open (attempt <total>, next check in <m>min).
    • Schedule next wake:
      • Load ScheduleWakeup via ToolSearch: select:ScheduleWakeup
      • Call with delaySeconds=<next>, prompt="/sse:pr-monitor", reason="watching PR #<n> for merge, interval <m>min".

First invocation (right after /sse:pr)

No state file yet. Initialize then schedule first wake at 3min (180s). Print:

PR monitor armed for #<n>. First check in 3min, escalates to 30min cap.

Read the full file on GitHub · 57 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. 11d ago First seen · 57 lines · 28 tokens per session scan A a1a8229dd7cd

Subscribe to this mod's changes

pr-monitor is a command published in the GitHub repository Pierry/harness-kit (3 stars, last pushed 1mo ago), licensed MIT. It adds 28 tokens to every session and 601 once invoked, about $0.0001 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.