01 Copies, found and merged

Your AI wrote it twice.
Twins keeps the one that builds.

Paste a GitHub repo. See every place your AI wrote the same code again, glowing on a map of your project. Merge the copies into one, and keep the merge only if your app still type checks.

cmonson66/nectarpay-crm · 159 files · createSupabaseFetch × 3

duplicate lines 59

02

The problem

AI coding tools copy instead of reuse. The copies drift, and bugs get fixed in one place only.

The agent cannot see the whole project at once, so it writes the same helper again. One app ends up with three ways to call the API and four ways to format a date, each slightly different, and nobody notices until a fix lands in one of them.

03

How it works

  1. 01

    Paste

    Any public GitHub link. Twins reads every TypeScript and JavaScript file and records a baseline: type errors, files checked, build.

  2. 02

    See

    Folders become rooms and files become cells. Every place the same code was written twice glows, with light drawn between the copies.

  3. 03

    Merge

    One click moves the code into one shared file and rewires every caller. Near copies go to the agent, which writes one shared version.

  4. 04

    Pull request

    Every kept merge is checked against the baseline. Take the patch, or open a pull request with one commit per merge.

04

Twins said no

Claude Code said done.
Twins said no.

Terminal · Claude Code

> merge every copy of createSupabaseFetch

● twins · compare-twins
● twins · merge-twins  edits: 3 files

Done. The three clients now share one helper.

The map, same second

SAID NO · UNDONE AUTOMATICALLY

  • src/integrations/supabase/client.server.ts:31 TS2554 Expected 2 arguments, but got 1.
  • src/integrations/supabase/auth-middleware.ts:40 TS2345 Argument of type 'string | undefined' is not assignable to parameter of type 'string'.

The check runs inside the merge action, not in the page. So it holds for you, for the built in agent, and for Claude Code over MCP. A merge that adds a single type error, or breaks a build that passed, is written back before anyone sees it.

05

From your agent

Use it from Claude Code.

Connect once and your coding agent gets the same tools as this page: import a repo, read the map, compare copies, merge, undo and export. The map you have open updates live while it works.

$ npx @agent-native/core@latest connect https://twins.jdollar.site
  • > find the copies in github.com/owner/repo
  • > merge every exact copy, biggest first
  • > write one shared version of formatDate
  • > export the patch

06

Questions

What counts as a copy?+

Two functions with the same structure after names and values are set aside. Exact copies have the same code and the same imports. Near copies have the same shape with small differences, and the agent handles those.

Does my code run on your server?+

No. The server only downloads the source and parses it. Installs, type checks and builds run inside an isolated sandbox with the network cut off after install.

What does said no mean?+

After a merge Twins type checks the whole app again. If there is even one error that was not in the baseline, or the build broke, the merge is written back to how it was and recorded as said no, with the exact errors.

Can Claude Code get around the check?+

No. The check lives inside the merge action itself. The page, the built in agent and Claude Code over MCP all call that same action, so the same rule applies to each of them.

Which repos work?+

Public TypeScript and JavaScript repos up to about 300 source files, with one tsconfig. Private repos and monorepos with many projects are not supported yet.

What do I get at the end?+

A patch you can apply with git, and soon a pull request on your repo. Each merge is listed with what moved and the lines removed.

One copy is enough.

Map a repo