{"record":{"id":"f770f9fced3725cd","repo":"eyaltoledano/claude-task-master","slug":"tag-oldtag-not-found-in-standard-format","errorCode":null,"errorMessage":"Tag ${oldTag} not found in standard format","messagePattern":"Tag (.+?) not found in standard format","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"packages/tm-core/src/modules/storage/adapters/file-storage/file-storage.ts","lineNumber":785,"sourceCode":"\t\t\t\t\t\t}\n\n\t\t\t\t\t\treturn existingData;\n\t\t\t\t\t} else {\n\t\t\t\t\t\tthrow new Error(`Tag ${oldTag} not found`);\n\t\t\t\t\t}\n\t\t\t\t} else if (oldTag === 'master') {\n\t\t\t\t\t// Convert standard format to legacy when renaming master\n\t\t\t\t\tconst masterTasks = existingData.tasks || [];\n\t\t\t\t\tconst masterMetadata = existingData.metadata || {};\n\n\t\t\t\t\treturn {\n\t\t\t\t\t\t[newTag]: {\n\t\t\t\t\t\t\ttasks: masterTasks,\n\t\t\t\t\t\t\tmetadata: { ...masterMetadata, tags: [newTag] }\n\t\t\t\t\t\t}\n\t\t\t\t\t};\n\t\t\t\t} else {\n\t\t\t\t\tthrow new Error(`Tag ${oldTag} not found in standard format`);\n\t\t\t\t}\n\t\t\t});\n\t\t} catch (error: any) {\n\t\t\tif (error.code === 'ENOENT') {\n\t\t\t\tthrow new Error(`Tag ${oldTag} not found - file doesn't exist`);\n\t\t\t}\n\t\t\tthrow error;\n\t\t}\n\t}\n\n\t/**\n\t * Copy a tag within the single tasks.json file\n\t */\n\tasync copyTag(sourceTag: string, targetTag: string): Promise<void> {\n\t\tconst tasks = await this.loadTasks(sourceTag);\n\n\t\tif (tasks.length === 0) {\n\t\t\tthrow new Error(`Source tag ${sourceTag} not found or has no tasks`);","sourceCodeStart":767,"sourceCodeEnd":803,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/storage/adapters/file-storage/file-storage.ts#L767-L803","documentation":"In renameTag, when tasks.json is in standard format the only valid rename source is 'master' (which converts the file to legacy format under the new name). Renaming any other tag against a standard-format file throws this error, since non-master tags only exist in legacy format.","triggerScenarios":"storage.renameTag('feature', 'feature-v2') while tasks.json is still standard/un-migrated format; scripts assuming the file was already converted to tagged format; renaming a tag right after project init when the file still uses {tasks, metadata} layout.","commonSituations":"Older projects not yet migrated to multi-tag storage; version upgrades introducing tagged format while automation still targets old assumptions; confusion between the 'master' pseudo-tag and real legacy tag keys.","solutions":["Migrate tasks.json to legacy/tagged format first, then rename the tag.","If the intent was to rename the implicit master set, call renameTag('master', newName) — that is the supported standard-format path.","Detect the file format before renaming and branch accordingly.","Create the new tag and copy tasks (copyTag) if a full migration is not desired."],"exampleFix":"// before\nawait storage.renameTag('feature', 'feature-v2'); // standard format file\n// after\nconst data = JSON.parse(fs.readFileSync(tasksPath, 'utf8'));\nif (Array.isArray(data.tasks)) {\n  await storage.renameTag('master', 'feature-v2'); // supported conversion path\n} else {\n  await storage.renameTag('feature', 'feature-v2');\n}","handlingStrategy":"validation","validationCode":"const data = JSON.parse(fs.readFileSync(tasksPath, 'utf8'));\nconst isStandardFormat = Array.isArray(data.tasks);\nif (isStandardFormat && oldTag !== 'master') {\n  throw new Error(`Only 'master' can be renamed in standard format; migrate tasks.json first`);\n}","typeGuard":"function isStandardFormat(data: unknown): data is { tasks: unknown[]; metadata?: object } {\n  return typeof data === 'object' && data !== null && Array.isArray((data as any).tasks);\n}","tryCatchPattern":"try {\n  await storage.renameTag(oldTag, newTag);\n} catch (err) {\n  if (err instanceof Error && err.message.includes('not found in standard format')) {\n    await migrateToTaggedFormat(tasksPath);\n    await storage.renameTag(oldTag, newTag);\n    return;\n  }\n  throw err;\n}","preventionTips":["Inspect tasks.json layout before renaming; standard format only supports renaming 'master'.","Migrate to tagged format as part of upgrade/onboarding scripts.","Rename 'master' explicitly when converting standard files to a named tag.","Keep automation aware of the format introduced by newer library versions."],"tags":["tag-management","file-format","not-found","migration"],"backgroundTag":"tag-not-found","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}