eyaltoledano/claude-task-master · error · Error

"${newName}" is a reserved tag name

Error message

"${newName}" is a reserved tag name

What it means

Tag names 'master', 'main', and 'default' are reserved and cannot be used as a rename target. renameTag() checks newName case-insensitively against this list to prevent creating tags that would collide with the default-tag machinery. Choose a non-reserved name.

Source

Thrown at scripts/modules/task-manager/tag-management.js:980

			throw new Error('New tag name is required and must be a string');
		}

		// Validate new tag name format
		if (!/^[a-zA-Z0-9_-]+$/.test(newName)) {
			throw new Error(
				'New tag name can only contain letters, numbers, hyphens, and underscores'
			);
		}

		// Prevent renaming master tag
		if (oldName === 'master') {
			throw new Error('Cannot rename the "master" tag');
		}

		// Reserved tag names
		const reservedNames = ['master', 'main', 'default'];
		if (reservedNames.includes(newName.toLowerCase())) {
			throw new Error(`"${newName}" is a reserved tag name`);
		}

		logFn.info(`Renaming tag from "${oldName}" to "${newName}"`);

		// Read current tasks data
		const data = readJSON(tasksPath, projectRoot);
		if (!data) {
			throw new Error(`Could not read tasks file at ${tasksPath}`);
		}

		// Use raw tagged data for tag operations
		const rawData = data._rawTaggedData || data;

		// Check if old tag exists
		if (!rawData[oldName]) {
			throw new Error(`Tag "${oldName}" does not exist`);
		}

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Pick a non-reserved target name (e.g. 'primary', 'base', 'production')
  2. Validate the target before calling: !['master','main','default'].includes(newName.toLowerCase())
  3. If you need 'main' as your working tag, create it with createTag and switch to it rather than renaming into it

Example fix

// before
await renameTag(tasksPath, 'master', 'main'); // also blocked by [393]
// after
await createTag(tasksPath, 'main', { copyFromCurrent: true });
await useTag(tasksPath, 'main');
Defensive patterns

Strategy: validation

Validate before calling

const RESERVED = ['master', 'main', 'default'];
if (RESERVED.includes(String(newName).toLowerCase())) {
  throw new Error(`"${newName}" is a reserved tag name`);
}

Type guard

function isAllowedTagName(name) {
  return typeof name === 'string' && !['master', 'main', 'default'].includes(name.toLowerCase());
}

Try / catch

try {
  await renameTag(tasksPath, oldName, newName);
} catch (err) {
  if (err.message.includes('is a reserved tag name')) {
    console.error(`Pick a non-reserved name (not master/main/default): got "${newName}"`);
    return;
  }
  throw err;
}

Prevention

When it happens

Trigger: Calling renameTag(tasksPath, oldName, 'master'|'main'|'default') (any letter case, e.g. 'MAIN'), attempting to turn an existing tag into a reserved name.

Common situations: Teams standardizing on 'main' trying to rename 'master' to 'main'; scripts generating canonical names that happen to be reserved; users thinking 'default' is a free name.

Related errors


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