paperclipai/paperclip · error · Error
No Paperclip worktrees were found. Run `paperclipai…
Error message
No Paperclip worktrees were found. Run `paperclipai worktree:list` to inspect the repo worktrees.
What it means
Empty-state sentinel when prompting for a source worktree: git worktree discovery in the current repo found no Paperclip-configured worktrees (all candidates were excluded), so there is nothing to pick as a merge source.
Solutions
- Provide a non-empty worktree selector (path, directory name, branch name, or "current").
Defensive patterns
Strategy: validation
When it happens
Trigger: Thrown at cli/src/commands/worktree.ts:2882 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/bdc16073a125d2ad.
Report an issue: GitHub.
Appendix: source
Thrown at cli/src/commands/worktree.ts:3697
if (!matched.hasPaperclipConfig && !matched.isCurrent) {
throw new Error(`Resolved worktree "${selector}" does not look like a Paperclip worktree.`);
}
return resolveEndpointFromChoice(matched);
}
async function promptForSourceEndpoint(excludeWorktreePath?: string): Promise<ResolvedWorktreeEndpoint> {
const excluded = excludeWorktreePath ? path.resolve(excludeWorktreePath) : null;
const currentEndpoint = resolveCurrentWorktreeEndpoint();
const choices = toMergeSourceChoices(process.cwd())
.filter((choice) => choice.hasPaperclipConfig || choice.isCurrent)
.filter((choice) => path.resolve(choice.worktree) !== excluded)
.map((choice) => ({
value: choice.isCurrent ? "__current__" : choice.worktree,
label: choice.branchLabel,
hint: `${choice.worktree}${choice.isCurrent ? " (current)" : ""}`,
}));
if (choices.length === 0) {
throw new Error("No Paperclip worktrees were found. Run `paperclipai worktree:list` to inspect the repo worktrees.");
}
const selection = await p.select<string>({
message: "Choose the source worktree to import from",
options: choices,
});
if (p.isCancel(selection)) {
throw new Error("Source worktree selection cancelled.");
}
if (selection === "__current__") {
return currentEndpoint;
}
return resolveWorktreeEndpointFromSelector(selection, { allowCurrent: true });
}
async function applyMergePlan(input: {
sourceStorages: ConfiguredStorage[];
targetStorage: ConfiguredStorage;
targetDb: ClosableDb;View on GitHub (pinned to 01ad858492)