{"record":{"id":"1fc2b472f8053ad6","repo":"paperclipai/paperclip","slug":"registered-worktree-for-branch-branchname-at","errorCode":null,"errorMessage":"Registered worktree for branch \"${branchName}\" at \"${registeredBranchWorktree}\" is not reusable${reason}.","messagePattern":"Registered worktree for branch \"(.+?)\" at \"(.+?)\" is not reusable(.+?)\\.","errorType":"exception","errorClass":null,"httpStatus":null,"severity":"error","filePath":"server/src/services/workspace-runtime.ts","lineNumber":3257,"sourceCode":"  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,\n      metadata: {\n        repoRoot,\n        worktreePath,\n        branchName,\n        baseRef,\n        baseRefSha: currentBaseRefSha,\n        created: true,\n      },\n      successMessage: `Created git worktree at ${worktreePath}\\n`,\n      failureLabel: `git worktree add ${worktreePath}`,\n    });","sourceCodeStart":3239,"sourceCodeEnd":3275,"githubUrl":"https://github.com/paperclipai/paperclip/blob/a7e689b3c35347b529cb9f54c9b9a8575a3dcab6/server/src/services/workspace-runtime.ts#L3239-L3275","documentation":"Git already has a worktree registered for the target branch at a different path, and that registered worktree is not reusable (reason appended). The branch cannot be checked out into a new worktree while the stale registration exists.","triggerScenarios":"Thrown at server/src/services/workspace-runtime.ts:3198 when the library encounters an invalid state.","commonSituations":"See trigger scenarios.","solutions":["The registered worktree for the branch is not reusable. Prune/repair it ('git worktree prune' or remove and recreate) and 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-14T05:17:10.506Z"}