{"record":{"id":"8e5c078e47f5e791","repo":"paperclipai/paperclip","slug":"target-config-input-configpath-does-not-look-li","errorCode":null,"errorMessage":"Target config ${input.configPath} does not look like a worktree-local Paperclip instance. Expected PAPERCLIP_HOME and PAPERCLIP_INSTANCE_ID in the adjacent .env.","messagePattern":"Target config (.+?) does not look like a worktree-local Paperclip instance\\. Expected PAPERCLIP_HOME and PAPERCLIP_INSTANCE_ID in the adjacent \\.env\\.","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":912,"sourceCode":"    fromDataDir: fromDataDir ?? undefined,\n    fromInstance,\n  });\n  return {\n    configPath,\n    label: configPath,\n  };\n}\n\nexport function resolveWorktreeReseedTargetPaths(input: {\n  configPath: string;\n  rootPath: string;\n}): WorktreeLocalPaths {\n  const envEntries = readPaperclipEnvEntries(resolvePaperclipEnvFile(input.configPath));\n  const homeDir = nonEmpty(envEntries.PAPERCLIP_HOME);\n  const instanceId = nonEmpty(envEntries.PAPERCLIP_INSTANCE_ID);\n\n  if (!homeDir || !instanceId) {\n    throw new Error(\n      `Target config ${input.configPath} does not look like a worktree-local Paperclip instance. Expected PAPERCLIP_HOME and PAPERCLIP_INSTANCE_ID in the adjacent .env.`,\n    );\n  }\n\n  return resolveWorktreeLocalPaths({\n    cwd: input.rootPath,\n    homeDir,\n    instanceId,\n  });\n}\n\nfunction resolveExistingGitWorktree(selector: string, cwd: string): MergeSourceChoice | null {\n  const trimmed = selector.trim();\n  if (trimmed.length === 0) return null;\n\n  const directPath = path.resolve(trimmed);\n  if (existsSync(directPath)) {\n    return {","sourceCodeStart":894,"sourceCodeEnd":930,"githubUrl":"https://github.com/paperclipai/paperclip/blob/67001ec6eb96ae601aa27bc91d9b2415d665334a/cli/src/commands/worktree.ts#L894-L930","documentation":"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.","triggerScenarios":"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.","commonSituations":"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.","solutions":["Re-run `paperclipai worktree init` for the target worktree so it regenerates the .env with PAPERCLIP_HOME and PAPERCLIP_INSTANCE_ID.","Manually add PAPERCLIP_HOME and PAPERCLIP_INSTANCE_ID to the worktree's .paperclip/.env.","Point the command at the correct worktree-local config path rather than the primary instance config.","Ensure .env is not gitignored out of worktree initialization."],"exampleFix":"# before: .paperclip/.env missing entries\n# after\nPAPERCLIP_HOME=/home/user/.paperclip\nPAPERCLIP_INSTANCE_ID=feat-x","handlingStrategy":"validation","validationCode":"function hasWorktreeEnvEntries(configPath: string): boolean {\n  const env = readPaperclipEnvEntries(resolvePaperclipEnvFile(configPath));\n  return Boolean(nonEmpty(env.PAPERCLIP_HOME) && nonEmpty(env.PAPERCLIP_INSTANCE_ID));\n}","typeGuard":"function isWorktreeLocalConfig(configPath: string): boolean {\n  try { return hasWorktreeEnvEntries(configPath); } catch { return false; }\n}","tryCatchPattern":null,"preventionTips":["Always create worktrees via `paperclipai worktree init` so the .env is written.","Do not strip .paperclip/.env during cleanup.","Validate target .env before invoking reseed."],"tags":["worktree","reseed","config","env","missing-argument"],"backgroundTag":null,"analyzedSha":"67001ec6eb96ae601aa27bc91d9b2415d665334a","analyzedAt":"2026-08-12T12:05:45.408Z","schemaVersion":2},"datasetVersion":"2026-08-12T18:17:37.767Z"}