eyaltoledano/claude-task-master · info · Error
Tag deletion cancelled
Error message
Tag deletion cancelled
What it means
When running in interactive text mode without the `yes` option, deleteTag() prompts for confirmation before removing a tag that contains tasks. If the user answers 'no' at the first confirmation prompt, the function throws 'Tag deletion cancelled' to abort the operation. This is control flow via exception, not a malfunction.
Source
Thrown at scripts/modules/task-manager/tag-management.js:353
borderStyle: 'round',
margin: { top: 1, bottom: 1 }
}
)
);
// First confirmation
const firstConfirm = await inquirer.prompt([
{
type: 'confirm',
name: 'proceed',
message: `Are you sure you want to delete tag "${tagName}" and its ${taskCount} tasks?`,
default: false
}
]);
if (!firstConfirm.proceed) {
logFn.info('Tag deletion cancelled by user');
throw new Error('Tag deletion cancelled');
}
// Second confirmation (double-check)
const secondConfirm = await inquirer.prompt([
{
type: 'input',
name: 'tagNameConfirm',
message: `To confirm deletion, please type the tag name "${tagName}":`,
validate: (input) => {
if (input === tagName) {
return true;
}
return `Please type exactly "${tagName}" to confirm deletion`;
}
}
]);
if (secondConfirm.tagNameConfirm !== tagName) {View on GitHub (pinned to c0c98d367c)
Solutions
- No action needed — nothing was deleted; the tag and its tasks are intact.
- Re-run the command and answer 'y' if you do want to delete, or use --yes to skip prompts when scripting.
- If prompts appear unintentionally in automation, pass { yes: true } in options or outputFormat 'json' to bypass interactive confirmation.
Example fix
// before (script hangs/prompts, or aborts on 'n')
await deleteTag(tasksPath, tag, {}, context);
// after (non-interactive)
await deleteTag(tasksPath, tag, { yes: true }, context); Defensive patterns
Strategy: try-catch
Try / catch
try {
await deleteTag(tasksPath, tag, opts, ctx);
} catch (e) {
if (e.message === 'Tag deletion cancelled') {
console.log('Deletion aborted by user; no changes made.');
return;
}
throw e;
} Prevention
- Pass { yes: true } when running non-interactively to skip prompts entirely.
- Catch and handle cancellation errors gracefully in custom UX built on deleteTag.
- Show the task count warning yourself before calling so users aren't surprised by the prompt.
When it happens
Trigger: Running `task-master delete-tag <name>` (or calling deleteTag without {yes:true}) in a TTY, seeing the warning box about N tasks being deleted, and answering 'n' at the 'Are you sure...' prompt.
Common situations: Users hesitating during a destructive operation, accidental invocations of the delete command, automated environments without TTY support where the prompt behaves unexpectedly.
Related errors
- MFA_VERIFICATION_FAILED
- Failed to get brief creation URL
- Failed to initialize services: ${(error as Error).message}
- Invalid format: ${options.format}. Valid formats are: text,
- Failed to fetch tasks from any tag. First error: ${failedTag
AI-assisted analysis of eyaltoledano/claude-task-master@c0c98d367c (2026-08-29).
Data as JSON: /api/errors/5fded5e9935f778d.
Report an issue: GitHub.