From 2e72054c0d355705c76c112d0a0e0448d4f95cdc Mon Sep 17 00:00:00 2001 From: Tomohisa Takaoka Date: Sat, 21 Feb 2026 01:24:13 -0800 Subject: [PATCH] fix: use plural 'takt-worktrees' as default clone directory name The default clone base directory was 'takt-worktree' (singular), which is inconsistent since multiple worktrees are created inside it. Changed to 'takt-worktrees' (plural) while maintaining backward compatibility: - If existing 'takt-worktree' directory exists, continue using it - New installations will use 'takt-worktrees' - Explicit worktree_dir config always takes priority --- src/infra/task/clone.ts | 13 +++++++++++-- 1 file changed, 11 insertions(+), 2 deletions(-) diff --git a/src/infra/task/clone.ts b/src/infra/task/clone.ts index ad4bc22..2d5e11d 100644 --- a/src/infra/task/clone.ts +++ b/src/infra/task/clone.ts @@ -33,7 +33,10 @@ export class CloneManager { /** * Resolve the base directory for clones from global config. - * Returns the configured worktree_dir (resolved to absolute), or ../ + * Returns the configured worktree_dir (resolved to absolute), or + * the default 'takt-worktrees' (plural). Automatically migrates + * legacy 'takt-worktree' (singular) to 'takt-worktrees' if only + * the legacy directory exists. */ private static resolveCloneBaseDir(projectDir: string): string { const worktreeDir = resolveConfigValue(projectDir, 'worktreeDir'); @@ -42,7 +45,13 @@ export class CloneManager { ? worktreeDir : path.resolve(projectDir, worktreeDir); } - return path.join(projectDir, '..', 'takt-worktree'); + const newDir = path.join(projectDir, '..', 'takt-worktrees'); + const legacyDir = path.join(projectDir, '..', 'takt-worktree'); + // Auto-migrate: rename legacy singular to plural + if (fs.existsSync(legacyDir) && !fs.existsSync(newDir)) { + fs.renameSync(legacyDir, newDir); + } + return newDir; } /** Resolve the clone path based on options and global config */