eyaltoledano/claude-task-master · error

Failed to get brief creation URL

Error message

Failed to get brief creation URL

What it means

copyTag reads the tasks file with readJSON and throws this error when the read returns null/undefined, meaning the tasks file is missing, unreadable, or unparseable at the given path. It aborts before performing any tag mutation to avoid creating data in a bogus location.

Source

Thrown at apps/cli/src/commands/briefs.command.ts:635

			// Check authentication
			if (!(await this.checkAuth())) {
				process.exit(1);
			}

			// Use the bridge to redirect to web UI
			const remoteResult = await tryAddTagViaRemote({
				tagName: name || 'new-brief',
				projectRoot: process.cwd(),
				report: (level: LogLevel, ...args: unknown[]) => {
					const message = args[0] as string;
					if (level === 'error') ui.displayError(message);
					else if (level === 'warn') ui.displayWarning(message);
					else if (level === 'info') ui.displayInfo(message);
				}
			});

			if (!remoteResult) {
				throw new Error('Failed to get brief creation URL');
			}

			this.setLastResult({
				success: remoteResult.success,
				action: 'create',
				message: remoteResult.message
			});

			if (!remoteResult.success) {
				process.exit(1);
			}
		} catch (error) {
			ui.displayErrorBox(`Failed to create brief: ${(error as Error).message}`);
			this.setLastResult({
				success: false,
				action: 'create',
				message: (error as Error).message
			});

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Verify tasks.json exists at the given path (run task-master init or create a task first)
  2. Correct the tasksPath / run from the project root
  3. Restore or fix malformed JSON in tasks.json (check for merge conflict markers)

Example fix

// before
await copyTag('/wrong/path/tasks.json', 'a', 'b');
// after
await copyTag(path.join(projectRoot, '.taskmaster', 'tasks', 'tasks.json'), 'a', 'b');
Defensive patterns

Strategy: validation

Validate before calling

const fs = require('fs');
if (!fs.existsSync(tasksPath)) {
  throw new Error('tasks.json missing at ' + tasksPath);
}
JSON.parse(fs.readFileSync(tasksPath, 'utf8')); // throws if malformed

Try / catch

try {
  await copyTag(tasksPath, source, target);
} catch (e) {
  if (e.message.startsWith('Could not read tasks file')) {
    throw new Error('Initialize tasks file first: task-master init');
  }
  throw e;
}

Prevention

When it happens

Trigger: Calling copyTag with a tasksPath that doesn't exist, points to a directory, or contains malformed JSON that readJSON cannot parse.

Common situations: Running copy-tag before `task-master init`/any task creation; wrong --file path passed to the CLI; tasks.json corrupted by a failed edit or merge conflict.

Understand the failure class

Background: "File not found" and ENOENT errors: why libraries can't find a file that should exist — this error's family across 50 libraries.

Related errors


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