{"record":{"id":"bec02f84ddb998f1","repo":"paperclipai/paperclip","slug":"target-path-already-exists-targetpath","errorCode":null,"errorMessage":"Target path already exists: ${targetPath}","messagePattern":"Target path already exists: (.+?)","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"cli/src/commands/worktree.ts","lineNumber":2638,"sourceCode":"    }\n    p.outro(pc.green(\"Worktree database seed complete.\"));\n  } catch (error) {\n    spinner.stop(pc.red(\"Failed to seed worktree database.\"));\n    throw error;\n  }\n}\n\nexport async function worktreeMakeCommand(nameArg: string, opts: WorktreeMakeOptions): Promise<void> {\n  printPaperclipCliBanner();\n  p.intro(pc.bgCyan(pc.black(\" paperclipai worktree:make \")));\n\n  const name = resolveWorktreeMakeName(nameArg);\n  const startPoint = resolveWorktreeStartPoint(opts.startPoint);\n  const sourceCwd = process.cwd();\n  const sourceConfigPath = resolveSourceConfigPath(opts);\n  const targetPath = resolveWorktreeMakeTargetPath(name);\n  if (existsSync(targetPath)) {\n    throw new Error(`Target path already exists: ${targetPath}`);\n  }\n\n  mkdirSync(path.dirname(targetPath), { recursive: true });\n  if (startPoint) {\n    const [remote] = startPoint.split(\"/\", 1);\n    try {\n      execFileSync(\"git\", [\"fetch\", remote], {\n        cwd: sourceCwd,\n        stdio: [\"ignore\", \"pipe\", \"pipe\"],\n      });\n    } catch (error) {\n      throw new Error(\n        `Failed to fetch from remote \"${remote}\": ${extractExecSyncErrorMessage(error) ?? String(error)}`,\n      );\n    }\n  }\n\n  const worktreeArgs = resolveGitWorktreeAddArgs({","sourceCodeStart":2620,"sourceCodeEnd":2656,"githubUrl":"https://github.com/paperclipai/paperclip/blob/01ad8584922b5d85292b1723cae71fa0d9b07a19/cli/src/commands/worktree.ts#L2620-L2656","documentation":"Clobber guard in worktree:make: the computed target worktree directory already exists on disk, so creating a new worktree there would overwrite existing content; the name or worktrees home must be changed.","triggerScenarios":"Thrown at cli/src/commands/worktree.ts:1823 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Choose a different target path.","Move or remove the existing directory at ${targetPath} and retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"01ad8584922b5d85292b1723cae71fa0d9b07a19","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-23T08:17:48.524Z"}