graftfork

Docs / For agents

Pairing Graftfork with Claude Ship

Claude Ship handles a pull request after it opens: Code Review checks it, PR Steward fixes failing checks and review comments, and Claude Approvals approves the changes your team's policy allows. Graftfork handles the half before that: watching upstream releases, replaying your fork's patches in a sandbox, running your tests, and opening a clean graft/<release> PR only when everything passes.

Why pair them instead of merging upstream in a PR?

Opening a scheduled PR that runs git merge upstream/main and handing the conflicts to a generic PR bot breaks down on real forks:

  • Merge-commit rot: Merging upstream into a fork across dozens of releases buries which lines are yours and why they exist.
  • Stale workarounds: A generic PR bot doesn't know why a patch was added: it will force-apply an old workaround even after upstream fixed the bug.
  • Noisy CI & token loops: Letting an agent thrash on a large upstream diff inside an open PR burns tokens and spams CI checks.

Graftfork replays your tracked commits cleanly in an isolated sandbox first. If any change can't land or a test newly fails, Graftfork opens no PR, leaves your repo untouched, and tells Claude Code exactly why it stopped.

01 · UPSTREAM RELEASE

Graftfork replays & tests

Detects the new release, replays each tracked patch using its commit reason, and runs your full test suite in a sandbox.

02 · CLEAN PR HANDOFF

Verified graft/<release> PR

Opens a pull request only when every change lands and tests pass, with a row-by-row summary of what was kept, adapted, or dropped.

03 · CLAUDE SHIP

Review & policy approval

Code Review checks the diff. Claude Approvals approves the sync if your policy allows it, or asks for a person.

Setup in 3 steps

  1. Connect Graftfork in Claude Code:
    /plugin marketplace add craigm26/graft-claude-code
    /plugin install graftfork@graftfork

    Had the plugin under its old name, graft (1.5 or earlier)? Install graftfork@graft-claude-code instead, then /plugin uninstall graft@graft-claude-code, and sign in again from /mcp. Upgrading

    Restart Claude Code, run /mcp, select plugin:graftfork:graftfork, and sign in. Or connect from the Claude Connector Directory.

  2. Turn on pull request delivery for your fork: In your Graftfork dashboard (or by asking Claude Code to track your fork), turn on pull request delivery so a verified sync opens a graft/<release> PR against your default branch.
  3. Add a Claude Approvals policy: Claude Ship is for Team and Enterprise plans; PR Steward and Claude Approvals are in public beta. Save the file below as .claude/approvals.yml and merge it into your default branch. It starts in mode: observe, so the check shows what it would decide without enforcing it. Delete that line once a few releases look right.

A starting .claude/approvals.yml

version: 1
mode: observe
rules:
  - purpose: "One person approves, unless Graftfork opened it and Code Review passes."
    paths: ["**"]
    verdict: { claude: comments, seats: 1 }
    advisory: [claude/code_review]
    override:
      - if: "ALL pr/authors = bot:graftfork-personal-sync AND claude/code_review = pass"
        verdict: { claude: approves, seats: 0 }
  - purpose: "Auth, billing and migrations always take a person who did not write the change."
    paths: ["auth/**", "billing/**", "migrations/**"]
    verdict: { claude: comments, seats: [{ count: 1, from: [humans, "!pr/authors"] }] }

What it does:

  • Graftfork's PRs only. ALL pr/authors holds only while Graftfork's app opened the PR and pushed every commit. If a person pushes a fix to the branch, the PR goes back to needing one approval. Check the PR author on your first sync and use that name after bot: (no [bot] suffix). Trusting the bot also trusts what it carries: upstream's release, with your changes moved onto it. Code Review and your tests are what check that code.
  • Strictest rule wins. Approvals applies every rule that matches, so a sync that touches auth/, billing/ or migrations/ still needs a person. Change those paths to fit your repo.
  • Major versions. The policy can't see release numbers, so a major bump is treated like any other sync. If that matters for your fork, drop the override and approve each sync yourself.
  • Seats 0. With seats: 0 a bot's PR can merge with no person looking at it. Graftfork has already run your tests and Code Review has passed, but leave it in observe mode until you trust both.

Syntax is in the Claude Approvals policy docs. PR Steward skips PRs a bot opened, so it won't watch Graftfork's PRs; your CI and Graftfork's own test run cover that step.

When a sync needs human input

If Graftfork stops on a conflict or asks a question, inspect and resolve it directly inside Claude Code (/graftfork:graft-status), then run /ship when you're ready to push. Your PR then goes through Code Review, PR Steward and the same approvals policy.

Agents and Claude CodeYour first syncTry a public fork