eyaltoledano/claude-task-master · warning

Source tag "${copyFromTag}" not found or has no tasks

Error message

Source tag "${copyFromTag}" not found or has no tasks

What it means

This warning is emitted by createTag when a copy source tag is explicitly specified via copyFromTag but resolving it with getTasksForTag yields zero tasks. It means the named tag does not exist in tasks.json or exists but holds no tasks, so the new tag will be created empty. It is a warning, not a throw; tag creation proceeds.

Source

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

				if (key !== '_rawTaggedData' && key !== 'tag') {
					rawData[key] = value;
				}
			}
		}

		// Check if tag already exists
		if (rawData[tagName]) {
			throw new Error(`Tag "${tagName}" already exists`);
		}

		// Determine source for copying tasks (only if explicitly requested)
		let sourceTasks = [];
		if (copyFromCurrent || copyFromTag) {
			const sourceTag = copyFromTag || getCurrentTag(projectRoot);
			sourceTasks = getTasksForTag(rawData, sourceTag);

			if (copyFromTag && sourceTasks.length === 0) {
				logFn.warn(`Source tag "${copyFromTag}" not found or has no tasks`);
			}

			logFn.info(`Copying ${sourceTasks.length} tasks from tag "${sourceTag}"`);
		} else {
			logFn.info('Creating empty tag (no tasks copied)');
		}

		// Create the new tag structure in raw data
		rawData[tagName] = {
			tasks: [...sourceTasks], // Create a copy of the tasks array
			metadata: {
				created: new Date().toISOString(),
				updated: new Date().toISOString(),
				description:
					description || `Tag created on ${new Date().toLocaleDateString()}`
			}
		};

View on GitHub (pinned to c0c98d367c)

Solutions

  1. List existing tags with 'task-master tags' and confirm the exact source tag name exists and has tasks.
  2. Fix the copyFromTag argument spelling/casing before calling createTag.
  3. If an empty source is intentional, omit copyFromTag (or accept the warning) — the tag is still created with zero tasks.
  4. Verify you are operating on the correct project root so rawData actually contains the tag.
  5. Use copyFromCurrent: true instead if you meant to copy the currently active tag's tasks.

Example fix

// before
await createTag(rawData, 'new-tag', projectRoot, { copyFromTag: 'backlog ' });
// after
await createTag(rawData, 'new-tag', projectRoot, { copyFromTag: 'backlog' });
Defensive patterns

Strategy: validation

Validate before calling

const tags = getTagNames(rawData); // or read tasks.json and inspect .tags
const src = 'backlog';
const sourceTasks = getTasksForTag(rawData, src);
if (!tags.includes(src) || sourceTasks.length === 0) {
  throw new Error(`Source tag "${src}" not found or has no tasks`);
}

Type guard

function isValidSourceTag(rawData, tag) {
  return Boolean(rawData?.tags?.[tag]) &&
    Array.isArray(rawData.tags[tag].tasks) &&
    rawData.tags[tag].tasks.length > 0;
}

Prevention

When it happens

Trigger: Calling createTag (or the 'task-master add-tag <name> --from-tag <tag>' CLI path) with a copyFromTag value that was never created, was deleted, is misspelled, or whose task list is empty.

Common situations: Typo in the source tag name (tags are case-sensitive strings in tasks.json); referencing a tag from another project/branch whose tasks.json lacks it; copying from a freshly created empty tag; stale docs or scripts referencing renamed tags.

Related errors


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