{"record":{"id":"5fdccdc15a8c7475","repo":"eyaltoledano/claude-task-master","slug":"cannot-move-subtask","errorCode":"CANNOT_MOVE_SUBTASK","errorMessage":"Cannot move subtask ${taskId} directly between tags.\n\nFirst promote it to a full task using:\n  task-master remove-subtask --id=${taskId} --convert","messagePattern":"Cannot move subtask (.+?) directly between tags\\.\n\nFirst promote it to a full task using:\n  task-master remove-subtask --id=(.+?) --convert","errorType":"error_code","errorClass":"DependencyError","httpStatus":null,"severity":"error","filePath":"scripts/modules/dependency-manager.js","lineNumber":1720,"sourceCode":"\t\t);\n\t}\n\n\tif (!sourceTag || typeof sourceTag !== 'string') {\n\t\tthrow new DependencyError(\n\t\t\tDEPENDENCY_ERROR_CODES.INVALID_SOURCE_TAG,\n\t\t\t'Source tag must be a valid string'\n\t\t);\n\t}\n\n\tif (!targetTag || typeof targetTag !== 'string') {\n\t\tthrow new DependencyError(\n\t\t\tDEPENDENCY_ERROR_CODES.INVALID_TARGET_TAG,\n\t\t\t'Target tag must be a valid string'\n\t\t);\n\t}\n\n\tif (taskId.includes('.')) {\n\t\tthrow new DependencyError(\n\t\t\tDEPENDENCY_ERROR_CODES.CANNOT_MOVE_SUBTASK,\n\t\t\t`Cannot move subtask ${taskId} directly between tags.\n\nFirst promote it to a full task using:\n  task-master remove-subtask --id=${taskId} --convert`,\n\t\t\t{\n\t\t\t\ttaskId,\n\t\t\t\tsourceTag,\n\t\t\t\ttargetTag\n\t\t\t}\n\t\t);\n\t}\n}\n\n/**\n * Check if a task can be moved with its dependencies\n * @param {string} taskId - Task ID to check\n * @param {string} sourceTag - Source tag name","sourceCodeStart":1702,"sourceCodeEnd":1738,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/scripts/modules/dependency-manager.js#L1702-L1738","documentation":"A DependencyError with code CANNOT_MOVE_SUBTASK thrown when moving a task between tags with a subtask ID like \"5.2\". Subtasks cannot be relocated across tags directly; the library requires promoting the subtask to a full task first via remove-subtask --convert. The error message embeds the exact command to run.","triggerScenarios":"Calling moveTask/move-task between two tags where taskId contains a dot (e.g. `task-master move-task --from=5.2 --to=tag-b` or programmatic moveTask('5.2', ...) with a targetTag).","commonSituations":"Reorganizing work across tag contexts (e.g. moving items from 'master' to a feature tag) and picking a subtask ID by mistake, or scripting bulk moves over a task list that includes subtasks.","solutions":["Promote the subtask first: task-master remove-subtask --id=5.2 --convert, then move the resulting full task between tags.","If the intent was the parent task, use its plain ID: move-task --id=5 --to=<tag> (moves the whole task).","In scripts, filter IDs containing '.' before calling the move operation.","After conversion, the new task ID appears in the target tag; move it there explicitly."],"exampleFix":"// before\ntask-master move-task --id=5.2 --to=feature-x\n// after\ntask-master remove-subtask --id=5.2 --convert\ntask-master move-task --id=<new-task-id> --to=feature-x","handlingStrategy":"validation","validationCode":"function assertMovableTaskId(id) {\n  if (typeof id !== 'string' || id.includes('.')) {\n    throw new Error(`${id} is a subtask; promote it with: task-master remove-subtask --id=${id} --convert before moving between tags`);\n  }\n}","typeGuard":"const isFullTaskId = (id) => typeof id === 'string' && /^\\d+$/.test(id);","tryCatchPattern":"try {\n  await moveTask(taskId, targetTag);\n} catch (e) {\n  if (e.code === 'CANNOT_MOVE_SUBTASK') {\n    console.log(e.message); // includes exact convert command\n    execSync(`task-master remove-subtask --id=${taskId} --convert`, { stdio: 'inherit' });\n    return;\n  }\n  throw e;\n}","preventionTips":["Filter out dotted subtask IDs before scripted bulk tag moves.","Promote subtasks with remove-subtask --convert before cross-tag relocation.","If you only need the parent moved, reference the parent's numeric ID."],"tags":["subtasks","tags","cli","dependency-manager"],"backgroundTag":"unsupported-operation-for-subtask","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}