paperclipai/paperclip · error · Error

Target config ${input.configPath} does not look like a workt

Error message

Target config ${input.configPath} does not look like a worktree-local Paperclip instance. Expected PAPERCLIP_HOME and PAPERCLIP_INSTANCE_ID in the adjacent .env.

What it means

Thrown by resolveWorktreeReseedTargetPaths when the .env adjacent to the target config.json lacks PAPERCLIP_HOME and/or PAPERCLIP_INSTANCE_ID. A worktree-local Paperclip instance must declare these so the reseed can locate the home dir and instance-scoped data/seed paths.

Source

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

    fromDataDir: fromDataDir ?? undefined,
    fromInstance,
  });
  return {
    configPath,
    label: configPath,
  };
}

export function resolveWorktreeReseedTargetPaths(input: {
  configPath: string;
  rootPath: string;
}): WorktreeLocalPaths {
  const envEntries = readPaperclipEnvEntries(resolvePaperclipEnvFile(input.configPath));
  const homeDir = nonEmpty(envEntries.PAPERCLIP_HOME);
  const instanceId = nonEmpty(envEntries.PAPERCLIP_INSTANCE_ID);

  if (!homeDir || !instanceId) {
    throw new Error(
      `Target config ${input.configPath} does not look like a worktree-local Paperclip instance. Expected PAPERCLIP_HOME and PAPERCLIP_INSTANCE_ID in the adjacent .env.`,
    );
  }

  return resolveWorktreeLocalPaths({
    cwd: input.rootPath,
    homeDir,
    instanceId,
  });
}

function resolveExistingGitWorktree(selector: string, cwd: string): MergeSourceChoice | null {
  const trimmed = selector.trim();
  if (trimmed.length === 0) return null;

  const directPath = path.resolve(trimmed);
  if (existsSync(directPath)) {
    return {

View on GitHub (pinned to 67001ec6eb)

Solutions

  1. Re-run `paperclipai worktree init` for the target worktree so it regenerates the .env with PAPERCLIP_HOME and PAPERCLIP_INSTANCE_ID.
  2. Manually add PAPERCLIP_HOME and PAPERCLIP_INSTANCE_ID to the worktree's .paperclip/.env.
  3. Point the command at the correct worktree-local config path rather than the primary instance config.
  4. Ensure .env is not gitignored out of worktree initialization.

Example fix

# before: .paperclip/.env missing entries
# after
PAPERCLIP_HOME=/home/user/.paperclip
PAPERCLIP_INSTANCE_ID=feat-x
Defensive patterns

Strategy: validation

Validate before calling

function hasWorktreeEnvEntries(configPath: string): boolean {
  const env = readPaperclipEnvEntries(resolvePaperclipEnvFile(configPath));
  return Boolean(nonEmpty(env.PAPERCLIP_HOME) && nonEmpty(env.PAPERCLIP_INSTANCE_ID));
}

Type guard

function isWorktreeLocalConfig(configPath: string): boolean {
  try { return hasWorktreeEnvEntries(configPath); } catch { return false; }
}

Prevention

When it happens

Trigger: Running a reseed/repair against a target config path whose sibling .env was never written or was stripped; the target was created by a flow other than `paperclipai worktree init` (which writes the .env); PAPERCLIP_HOME/PAPERCLIP_INSTANCE_ID are commented out or empty in the .env.

Common situations: Manual config.json copy without the .env; .env gitignored and not present after a fresh clone; instance renamed without updating the .env; running reseed against the primary instance config instead of a worktree-local one.

Related errors


AI-assisted analysis of paperclipai/paperclip@67001ec6eb (2026-08-12). Data as JSON: /api/errors/8e5c078e47f5e791. Report an issue: GitHub.