{"record":{"id":"7ff5a79daca61f5c","repo":"eyaltoledano/claude-task-master","slug":"tagname-is-a-reserved-tag-name","errorCode":null,"errorMessage":"\"${tagName}\" 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":99,"sourceCode":"\n\t// Otherwise, continue with file-based logic below\n\ttry {\n\t\t// Validate tag name\n\t\tif (!tagName || typeof tagName !== 'string') {\n\t\t\tthrow new Error('Tag name is required and must be a string');\n\t\t}\n\n\t\t// Validate tag name format (alphanumeric, hyphens, underscores only)\n\t\tif (!/^[a-zA-Z0-9_-]+$/.test(tagName)) {\n\t\t\tthrow new Error(\n\t\t\t\t'Tag name can only contain letters, numbers, hyphens, and underscores'\n\t\t\t);\n\t\t}\n\n\t\t// Reserved tag names\n\t\tconst reservedNames = ['master', 'main', 'default'];\n\t\tif (reservedNames.includes(tagName.toLowerCase())) {\n\t\t\tthrow new Error(`\"${tagName}\" is a reserved tag name`);\n\t\t}\n\n\t\tlogFn.info(`Creating new tag: ${tagName}`);\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 - ensure we get the actual tagged structure\n\t\tlet rawData;\n\t\tif (data._rawTaggedData) {\n\t\t\t// If we have _rawTaggedData, use it (this is the clean tagged structure)\n\t\t\trawData = data._rawTaggedData;\n\t\t} else if (data.tasks && !data.master) {\n\t\t\t// This is legacy format - create a master tag structure\n\t\t\trawData = {","sourceCodeStart":81,"sourceCodeEnd":117,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/task-manager/tag-management.js#L81-L117","documentation":"createTag reserves the names 'master', 'main', and 'default' (case-insensitive) because these are the implicit/default tag contexts managed by the library itself. Attempting to create a tag with one of these names throws this error to avoid shadowing or conflicting with built-in tag handling.","triggerScenarios":"createTag('master'), createTag('DEFAULT'), or any casing variant of master/main/default; automation generating tags from branch names like 'main'.","commonSituations":"Scripts syncing git branch names into tags where the main branch is 'main'; users trying to explicitly recreate the default tag.","solutions":["Choose a different, descriptive tag name (e.g. 'main-copy', 'prod-baseline')","If the goal is the default context, just use the existing default tag instead of creating one","Rename via a distinct name and copy tasks with --copy-from-current if needed"],"exampleFix":"// before\nawait createTag(tasksPath, 'main');\n// after\nawait createTag(tasksPath, 'main-baseline');","handlingStrategy":"validation","validationCode":"const RESERVED = ['master', 'main', 'default'];\nif (RESERVED.includes(String(tagName).toLowerCase())) {\n  throw new Error(`'${tagName}' is reserved; pick another tag name`);\n}","typeGuard":"function isReservedTagName(name) {\n  return ['master', 'main', 'default'].includes(String(name).toLowerCase());\n}","tryCatchPattern":"try {\n  await createTag(tasksPath, tagName, {});\n} catch (err) {\n  if (err.message.includes('is a reserved tag name')) {\n    console.error(`Use a distinct name such as '${tagName}-baseline' or operate on the default tag directly.`);\n  } else throw err;\n}","preventionTips":["Filter reserved names out of any automation that derives tags from branch names","Document that master/main/default are implicit contexts","Use the default tag directly instead of trying to (re)create it","Add a suffix convention (e.g. -baseline, -snapshot) for near-reserved names"],"tags":["validation","reserved-names","tagging"],"backgroundTag":"reserved-name-conflict","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}