{"record":{"id":"e27f5346cae8a971","repo":"eyaltoledano/claude-task-master","slug":"newname-is-a-reserved-tag-name","errorCode":null,"errorMessage":"\"${newName}\" is a reserved tag name","messagePattern":"\"(.+?)\" is a reserved tag name","errorType":"validation","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/modules/task-manager/tag-management.js","lineNumber":980,"sourceCode":"\t\t\tthrow new Error('New tag name is required and must be a string');\n\t\t}\n\n\t\t// Validate new tag name format\n\t\tif (!/^[a-zA-Z0-9_-]+$/.test(newName)) {\n\t\t\tthrow new Error(\n\t\t\t\t'New tag name can only contain letters, numbers, hyphens, and underscores'\n\t\t\t);\n\t\t}\n\n\t\t// Prevent renaming master tag\n\t\tif (oldName === 'master') {\n\t\t\tthrow new Error('Cannot rename the \"master\" tag');\n\t\t}\n\n\t\t// Reserved tag names\n\t\tconst reservedNames = ['master', 'main', 'default'];\n\t\tif (reservedNames.includes(newName.toLowerCase())) {\n\t\t\tthrow new Error(`\"${newName}\" is a reserved tag name`);\n\t\t}\n\n\t\tlogFn.info(`Renaming tag from \"${oldName}\" to \"${newName}\"`);\n\n\t\t// Read current tasks data\n\t\tconst data = readJSON(tasksPath, projectRoot);\n\t\tif (!data) {\n\t\t\tthrow new Error(`Could not read tasks file at ${tasksPath}`);\n\t\t}\n\n\t\t// Use raw tagged data for tag operations\n\t\tconst rawData = data._rawTaggedData || data;\n\n\t\t// Check if old tag exists\n\t\tif (!rawData[oldName]) {\n\t\t\tthrow new Error(`Tag \"${oldName}\" does not exist`);\n\t\t}\n","sourceCodeStart":962,"sourceCodeEnd":998,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/task-manager/tag-management.js#L962-L998","documentation":"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.","triggerScenarios":"Calling renameTag(tasksPath, oldName, 'master'|'main'|'default') (any letter case, e.g. 'MAIN'), attempting to turn an existing tag into a reserved name.","commonSituations":"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.","solutions":["Pick a non-reserved target name (e.g. 'primary', 'base', 'production')","Validate the target before calling: !['master','main','default'].includes(newName.toLowerCase())","If you need 'main' as your working tag, create it with createTag and switch to it rather than renaming into it"],"exampleFix":"// before\nawait renameTag(tasksPath, 'master', 'main'); // also blocked by [393]\n// after\nawait createTag(tasksPath, 'main', { copyFromCurrent: true });\nawait useTag(tasksPath, 'main');","handlingStrategy":"validation","validationCode":"const RESERVED = ['master', 'main', 'default'];\nif (RESERVED.includes(String(newName).toLowerCase())) {\n  throw new Error(`\"${newName}\" is a reserved tag name`);\n}","typeGuard":"function isAllowedTagName(name) {\n  return typeof name === 'string' && !['master', 'main', 'default'].includes(name.toLowerCase());\n}","tryCatchPattern":"try {\n  await renameTag(tasksPath, oldName, newName);\n} catch (err) {\n  if (err.message.includes('is a reserved tag name')) {\n    console.error(`Pick a non-reserved name (not master/main/default): got \"${newName}\"`);\n    return;\n  }\n  throw err;\n}","preventionTips":["Keep the reserved list ['master','main','default'] in your own validation constants","Compare case-insensitively since the library lowercases before checking","Offer users an alternative suggestion when a reserved name is typed"],"tags":["tag-management","naming-convention","validation"],"backgroundTag":"reserved-name-conflict","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}