paperclipai/paperclip · error
${extractExecSyncErrorMessage(error) ?? String(error)}
Error message
${extractExecSyncErrorMessage(error) ?? String(error)} What it means
execFileSync('git worktree add ...') failed while creating the git worktree; extractExecSyncErrorMessage pulls the underlying git/stderr text, so the message is git's own failure output (branch conflict, bad path, etc.).
Solutions
- Read the underlying git error in the message, fix it, and retry.
Defensive patterns
Strategy: try-catch
When it happens
Trigger: Thrown at cli/src/commands/worktree.ts:1009 when the library encounters an invalid state.
Common situations: See trigger scenarios.
AI-assisted analysis of paperclipai/paperclip@01ad858492 (2026-08-18).
Data as JSON: /api/errors/14c514ec3771ef73.
Report an issue: GitHub.
Appendix: source
Thrown at cli/src/commands/worktree.ts:1025
}
mkdirSync(path.dirname(targetPath), { recursive: true });
const spinner = p.spinner();
spinner.start(`Creating git worktree for ${branchName}...`);
try {
execFileSync("git", resolveGitWorktreeAddArgs({
branchName,
targetPath,
branchExists: localBranchExists(repoRoot, branchName),
}), {
cwd: repoRoot,
stdio: ["ignore", "pipe", "pipe"],
});
spinner.stop(`Created git worktree at ${targetPath}.`);
} catch (error) {
spinner.stop(pc.red("Failed to create git worktree."));
throw new Error(extractExecSyncErrorMessage(error) ?? String(error));
}
installDependenciesBestEffort(targetPath);
return {
rootPath: targetPath,
configPath: path.resolve(targetPath, ".paperclip", "config.json"),
label: branchName,
branchName,
created: true,
};
}
function resolveSourceConnectionString(config: PaperclipConfig, envEntries: Record<string, string>, portOverride?: number): string {
if (config.database.mode === "postgres") {
const connectionString = nonEmpty(envEntries.DATABASE_URL) ?? nonEmpty(config.database.connectionString);
if (!connectionString) {
throw new Error(View on GitHub (pinned to 01ad858492)