eyaltoledano/claude-task-master · warning

.taskmaster directory already exists. Use --force to overwri

Error message

.taskmaster directory already exists. Use --force to overwrite or skip migration.

What it means

migrateProject performs the legacy-to-new layout migration (moving files into .taskmaster/). If the destination .taskmaster directory already exists and --force was not passed, migration aborts with this warning before touching anything, to avoid clobbering an existing installation.

Source

Thrown at scripts/modules/task-manager/migrate.js:35

	info: (msg) => console.log(chalk.blue('ℹ'), msg),
	warn: (msg) => console.log(chalk.yellow('⚠'), msg),
	error: (msg) => console.error(chalk.red('✗'), msg),
	success: (msg) => console.log(chalk.green('✓'), msg)
});

/**
 * Main migration function
 * @param {Object} options - Migration options
 */
export async function migrateProject(options = {}) {
	const projectRoot = findProjectRoot() || process.cwd();

	log.info(`Starting migration in: ${projectRoot}`);

	// Check if .taskmaster directory already exists
	const taskmasterDir = path.join(projectRoot, '.taskmaster');
	if (fs.existsSync(taskmasterDir) && !options.force) {
		log.warn(
			'.taskmaster directory already exists. Use --force to overwrite or skip migration.'
		);
		return;
	}

	// Analyze what needs to be migrated
	const migrationPlan = analyzeMigrationNeeds(projectRoot);

	if (migrationPlan.length === 0) {
		log.info(
			'No files to migrate. Project may already be using the new structure.'
		);
		return;
	}

	// Show migration plan
	log.info('Migration plan:');
	for (const item of migrationPlan) {

View on GitHub (pinned to c0c98d367c)

Solutions

  1. If the project is already migrated, do nothing — this is expected.
  2. If you intentionally want to re-run and overwrite, re-run with --force: task-master migrate --force.
  3. Back up the .taskmaster directory before using --force so nothing is lost.

Example fix

// before
task-master migrate
// after
task-master migrate --force
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
if (fs.existsSync('.taskmaster')) {
  console.log('Already migrated; skipping (or pass --force to overwrite)');
}

Prevention

When it happens

Trigger: Running the migrate command (registered via registerCommands) in a project root where .taskmaster/ already exists, without options.force set.

Common situations: Re-running migration after a partial/complete migration; running migrate in a project already on the new layout by mistake; forgetting the --force flag when intentionally re-migrating.

Related errors


AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29). Data as JSON: /api/errors/93d48c579c1dd413. Report an issue: GitHub.