eyaltoledano/claude-task-master · error

NO_ORGANIZATIONS

NO_ORGANIZATIONS

Error message

No organizations available. Please create an organization in Hamster first.

What it means

generateBriefFromTasks reaches the org-resolution step without an orgId, queries authManager.getOrganizations() for the authenticated user, and finds the account has zero organizations. The library refuses to guess an org, since every brief must belong to one. It is a soft (non-throwing) failure result.

Source

Thrown at packages/tm-core/src/modules/integration/services/export.service.ts:829

		if (!isAuthenticated) {
			throw new TaskMasterError(
				'Authentication required for export',
				ERROR_CODES.AUTHENTICATION_ERROR
			);
		}

		// Get current context for org ID
		const context = await this.authManager.getContext();
		let orgId = options.orgId || context?.orgId;

		// If no org in context, try to fetch and use the user's organizations
		if (!orgId) {
			const organizations = await this.authManager.getOrganizations();
			if (organizations.length === 0) {
				return {
					success: false,
					error: {
						code: 'NO_ORGANIZATIONS',
						message:
							'No organizations available. Please create an organization in Hamster first.'
					}
				};
			}
			// Use the first organization (most common case: user has one org)
			orgId = organizations[0].id;
		}

		// Get tasks from the specified or active tag
		const activeTag = this.configManager.getActiveTag();
		const tag = options.tag || activeTag;

		// Always read tasks from local file storage for export
		const fileStorage = new FileStorage(this.configManager.getProjectRoot());
		await fileStorage.initialize();

		// Load tasks with filters applied

View on GitHub (pinned to c0c98d367c)

Solutions

  1. Log into Hamster and create an organization, then retry.
  2. Pass an explicit orgId in the options if you have one.
  3. Run `tm auth` to confirm the session and check which orgs the account can see.
  4. Verify you authenticated with the intended account (not a throwaway).

Example fix

// before
await exportService.generateBriefFromTasks({ title: 'My brief' });
// after
await exportService.generateBriefFromTasks({ title: 'My brief', orgId: 'org_123' }); // or create an org in Hamster first
Defensive patterns

Strategy: validation

Validate before calling

const orgs = await tmCore.auth.getOrganizations();
if (orgs.length === 0) throw new Error('Create an organization in Hamster before generating briefs');

Type guard

function hasOrgId(o: { orgId?: string | null }): o is { orgId: string } {
  return typeof o.orgId === 'string' && o.orgId.length > 0;
}

Try / catch

const result = await exportService.generateBriefFromTasks(opts);
if (!result.success && result.error?.code === 'NO_ORGANIZATIONS') {
  promptUser('Create an organization in Hamster, then retry.');
}

Prevention

When it happens

Trigger: Calling generateBriefFromTasks with no orgId in options and no orgId in the stored auth context, while the authenticated Hamster user belongs to no organization.

Common situations: Newly signed-up Hamster accounts that haven't created an org yet, sandbox/test accounts, or accounts where the user was removed from all orgs.

Related errors


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