regraft lets you copy code from any git repo, rewrite it to fit your project, and still pull upstream updates later.
$ curl -fsSL https://useregraft.com/install.sh | bashadd → edit → note → pull → resolve. That's it.
┌──────────────────┐ regraft add ┌─────────────────────┐
│ upstream repo │───────────────────▶│ your repo │
│ (any git host) │ │ lib/components/ │
└────────┬─────────┘ │ regraft.json ✓ │
│ │ PATCH.md ✓ │
│ new commits └──────────┬──────────┘
▼ │ edit + note
┌──────────────────┐ regraft pull │
│ three-way merge │◀──────────────────────────────┘
│ (diff3) │
└────────┬─────────┘
│
┌────┴─────────────────┐
▼ ▼
no overlap conflict
merges on its own markers + brief ──▶ regraft resolveregraft add --name copies the files in and creates a named Graft with a stable ID and an exclusively owned destinationregraft note. One sentence, saved in PATCH.mdregraft pull <name> brings in upstream Updates. Changes that don't touch your edits merge on their ownregraft resolveEach named Graft records its source, pinned revision, owned destination, and separate upstream and local state. So regraft knows whether you changed a file, upstream did, or both.
After editing, write one sentence with regraft note. Intent stays tied to the exact Graft files and content you changed, so future conflicts arrive with your reasons, not just a diff.
Updates merge into your edited copy the same way git merges branches. Your accepted local version is tracked separately, so adaptations survive update after update.
When an update needs a human call, regraft saves the pending work and writes a short brief: what clashed, why you changed it, and what upstream did. You or your agent decides.
regraft fetches with your own git and your existing credentials. If git clone works (GitHub, GitLab, self-hosted, private), regraft works. No tokens, no rate limits.
regraft status exits 1 when something needs attention. regraft inspect returns provenance, Intent, status, pending Updates, and Briefs as versioned JSON.
Whole repos, directories, single files, branches, tags, and open PRs. Maintainers can also publish stable, named source surfaces in regraft.yaml.
Fetching uses your own git and your existing credentials (GitHub, GitLab, self-hosted, private). No tokens, no rate limits.
A few habits that pay off once copied code is part of your codebase.
regraft does the mechanical work: fetching, tracking, merging. regraft inspect <name> --json gives an agent the canonical context. When an Update needs judgment, it stays pending until you or the agent makes the call.
If an agent works in your repo, point it at skills/regraft/SKILL.md.
Copying, merging, and where regraft draws the line.
Free and open source. Install it and track your first copy in under a minute.