for agents finishing pull requests

Get your agent's PRs to merge-ready

Your coding agent fixes the code. Shepherd tells it what GitHub wants next: every review comment, every failing check, and the merge requirements GitHub reports, in one call.

Modeled at about 34% cheaper per PR than gh and 75% cheaper than the GitHub MCP server. A modeled PR session spends about 33 GraphQL points of your GitHub quota, against 96 for gh.

$ pr-shepherd 123

# PR #123 [TRIAGE]

status UNRESOLVED_COMMENTS · repo owner/repo
summary 3 passing

## Review threads

### src/commands/iterate/index.mts:42 (@alice · MEMBER)

> The variable name is misleading.

## Failing checks

- CI › lint / typecheck / test (22.x) [conclusion: FAILURE]
  > oxfmt

## Instructions

1. Fix each warranted item.
2. Triage ## Failing checks. Playbook: "CI failure triage".
3. Commit and push any changes.
4. Journal key decisions or rejections with URLs or IDs: pr-shepherd apply journal 123 '- <decision>'
5. $CHANGE_MESSAGE: one sentence on what changed. Run even if no code changed: pr-shepherd apply review 123 --reply-thread-ids PRRT_kwDOSGizTs58XB1L --message "$CHANGE_MESSAGE" --require-sha HEAD
6. Rerun Shepherd now.

What you get

  • It sees the whole PR One call returns review threads, comments, CI failures with log excerpts when available, and the real merge requirements. It handles 79 GitHub edge cases, like a cancelled run that needs a rerun rather than a code fix.
  • It costs less to run A modeled 34% lower cost per PR session than gh (30–38% across realistic context sizes), and 75% lower than the GitHub MCP server, assuming a warm prompt cache.
  • Your agent knows what to do next Every tick ends in one action, and every action but CANCEL comes with numbered steps. Across 71 PR states, the agent scores 0.95 with the plugin and 0.57 with gh and the GitHub MCP server.
  • It's easy on your rate limit A modeled PR session spends about 33 GraphQL points against 96 for gh. Waiting on CI costs about 60 points an hour, against about 360 for gh pr checks --watch. Unchanged idle waits can cost as little as 4.
  • It never touches your git Shepherd runs zero git mutations and never merges on its own. For a single PR, it hands off to a human only for 9 specific reasons.
  • It works with your agent Plugins for Claude Code, Codex, and Grok, a CLI for shells and CI, and an opt-in local stdio MCP server. Native stacked PRs are supported.

How it works

Your agent asks Shepherd about a PR. Shepherd reads GitHub and answers with exactly one action:

A stack poll can also return SHEPHERD, which starts a session for each stack layer you own.

The agent follows the printed steps, pushes, and asks again. READY means a clean PR is settling; the loop ends at CANCEL, or at ESCALATE when a human is needed. The agent still decides what each comment deserves.

Install

Claude Code

claude plugin marketplace add jongleberry/ratchet-stack
claude plugin install pr-shepherd@ratchet-stack

Previously added the pr-shepherd marketplace? Run claude plugin marketplace remove pr-shepherd first.

Codex

codex plugin marketplace add jongleberry/ratchet-stack --ref main
codex plugin add pr-shepherd@ratchet-stack

Previously added the pr-shepherd marketplace? Run codex plugin remove pr-shepherd@pr-shepherd and codex plugin marketplace remove pr-shepherd first.

Grok

grok plugin marketplace add jongleberry/pr-shepherd
grok plugin install pr-shepherd --trust

MCP only

npx --yes --package pr-shepherd@latest pr-shepherd-mcp

CLI, for shells and CI

pnpm i -g pr-shepherd

Then ask your agent to shepherd a PR, for example /goal /pr-shepherd:pr-shepherd 42 in Claude Code.

Where to go next

  • README Benefits, with links to the evidence behind each number, plus usage and install.
  • Principles The beliefs behind the design.
  • GitHub Source, issues, and releases.