{"record":{"id":"502c7da1825177f3","repo":"paperclipai/paperclip","slug":"configured-worktree-path-worktreepath-already","errorCode":null,"errorMessage":"Configured worktree path \"${worktreePath}\" already exists and is not a reusable git worktree${reason}.","messagePattern":"Configured worktree path \"(.+?)\" already exists and is not a reusable git worktree(.+?)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/workspace-runtime.ts","lineNumber":3246,"sourceCode":"      }).catch(() => null);\n      return {\n        validation: nextValidation,\n        branchName: effectiveBranchName,\n        warnings: coherence.warnings,\n      };\n    }\n    return { validation, branchName, warnings: [] };\n  }\n\n  const existingWorktree = await directoryExists(worktreePath);\n  if (existingWorktree) {\n    const reusable = await validateReusableWorktree(worktreePath);\n    if (reusable.validation?.valid) {\n      return await reuseExistingWorktree(worktreePath, reusable.branchName, reusable.warnings);\n    }\n    const validation = reusable.validation;\n    const reason = validation && !validation.valid ? ` (${validation.reason})` : \"\";\n    throw new Error(`Configured worktree path \"${worktreePath}\" already exists and is not a reusable git worktree${reason}.`);\n  }\n\n  const registeredBranchWorktree = await findRegisteredGitWorktreeByBranch(repoRoot, branchName);\n  if (registeredBranchWorktree) {\n    const reusable = await validateReusableWorktree(registeredBranchWorktree);\n    if (reusable.validation?.valid) {\n      return await reuseExistingWorktree(registeredBranchWorktree, reusable.branchName, reusable.warnings);\n    }\n    const validation = reusable.validation;\n    const reason = validation && !validation.valid ? ` (${validation.reason})` : \"\";\n    throw new Error(`Registered worktree for branch \"${branchName}\" at \"${registeredBranchWorktree}\" is not reusable${reason}.`);\n  }\n\n  try {\n    await recordGitOperation(input.recorder, {\n      phase: \"worktree_prepare\",\n      args: [\"worktree\", \"add\", \"-b\", branchName, worktreePath, baseRef],\n      cwd: repoRoot,","sourceCodeStart":3228,"sourceCodeEnd":3264,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/services/workspace-runtime.ts#L3228-L3264","documentation":"Workspace preparation found the configured worktree path already exists on disk but validateReusableWorktree deemed it not a reusable git worktree (reason appended). Rather than clobber an unknown directory, preparation refuses and the operator must inspect or remove it.","triggerScenarios":"Thrown at server/src/services/workspace-runtime.ts:3187 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["Remove or relocate the existing directory at the worktree path, or fix it into a valid git worktree, then retry."],"exampleFix":null,"handlingStrategy":"validation","validationCode":null,"typeGuard":null,"tryCatchPattern":null,"preventionTips":[],"tags":[],"backgroundTag":null,"analyzedSha":"a7e689b3c35347b529cb9f54c9b9a8575a3dcab6","analyzedAt":"2026-08-18T22:49:45.177Z","contentChangedAt":"2026-08-18T22:49:45.177Z","schemaVersion":2},"datasetVersion":"2026-09-14T00:17:10.932Z"}