paperclipai/paperclip · error · Error

Source and target Paperclip configs are the same. Use…

Error message

Source and target Paperclip configs are the same. Use --from-config/--from-instance to point repair at a different source.

What it means

Self-repair guard in worktree repair: the resolved repair source config is the same file as the repair target's config, meaning the worktree would reseed from itself; the --from-config/--from-instance flags must point at a different source.

Solutions

  1. Use --from-config or --from-instance to point repair at a different source instance.
Defensive patterns

Strategy: validation

When it happens

Trigger: Thrown at cli/src/commands/worktree.ts:3519 when the library encounters an invalid state.

Common situations: See trigger scenarios.


AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18). Data as JSON: /api/errors/45eadc9446d67f9c. Report an issue: GitHub.

Appendix: source

Thrown at cli/src/commands/worktree.ts:4380

  }

  const target = await ensureRepairTargetWorktree({
    selector: nonEmpty(opts.branch) ?? undefined,
    seedMode,
    opts,
  });
  if (!target) {
    p.log.warn("Current checkout is the primary repo worktree. Pass --branch to create or repair a linked worktree.");
    p.outro(pc.yellow("No worktree repaired."));
    return;
  }

  const source = resolveWorktreeRepairSource(opts);
  if (!existsSync(source.configPath)) {
    throw new Error(`Source config not found at ${source.configPath}.`);
  }
  if (path.resolve(source.configPath) === path.resolve(target.configPath)) {
    throw new Error("Source and target Paperclip configs are the same. Use --from-config/--from-instance to point repair at a different source.");
  }

  const targetConfig = existsSync(target.configPath) ? readConfig(target.configPath) : null;
  const targetEnvEntries = readPaperclipEnvEntries(resolvePaperclipEnvFile(target.configPath));
  const targetHasWorktreeEnv = Boolean(
    nonEmpty(targetEnvEntries.PAPERCLIP_HOME) && nonEmpty(targetEnvEntries.PAPERCLIP_INSTANCE_ID),
  );

  if (targetConfig && targetHasWorktreeEnv && opts.noSeed) {
    p.log.message(pc.dim(`Target ${target.label} already has worktree-local config/env. Skipping reseed because --no-seed was passed.`));
    p.outro(pc.green(`Worktree metadata already looks healthy for ${target.label}.`));
    return;
  }

  if (targetConfig && targetHasWorktreeEnv) {
    await runWorktreeReseed({
      fromConfig: source.configPath,
      to: target.rootPath,

View on GitHub (pinned to 01ad858492)