{"record":{"id":"0cf5753eec481962","repo":"eyaltoledano/claude-task-master","slug":"no-organizations","errorCode":"NO_ORGANIZATIONS","errorMessage":"No organizations available. Please create an organization in Hamster first.","messagePattern":"No organizations available\\. Please create an organization in Hamster first\\.","errorType":"error_code","errorClass":null,"httpStatus":null,"severity":"error","filePath":"packages/tm-core/src/modules/integration/services/export.service.ts","lineNumber":829,"sourceCode":"\t\tif (!isAuthenticated) {\n\t\t\tthrow new TaskMasterError(\n\t\t\t\t'Authentication required for export',\n\t\t\t\tERROR_CODES.AUTHENTICATION_ERROR\n\t\t\t);\n\t\t}\n\n\t\t// Get current context for org ID\n\t\tconst context = await this.authManager.getContext();\n\t\tlet orgId = options.orgId || context?.orgId;\n\n\t\t// If no org in context, try to fetch and use the user's organizations\n\t\tif (!orgId) {\n\t\t\tconst organizations = await this.authManager.getOrganizations();\n\t\t\tif (organizations.length === 0) {\n\t\t\t\treturn {\n\t\t\t\t\tsuccess: false,\n\t\t\t\t\terror: {\n\t\t\t\t\t\tcode: 'NO_ORGANIZATIONS',\n\t\t\t\t\t\tmessage:\n\t\t\t\t\t\t\t'No organizations available. Please create an organization in Hamster first.'\n\t\t\t\t\t}\n\t\t\t\t};\n\t\t\t}\n\t\t\t// Use the first organization (most common case: user has one org)\n\t\t\torgId = organizations[0].id;\n\t\t}\n\n\t\t// Get tasks from the specified or active tag\n\t\tconst activeTag = this.configManager.getActiveTag();\n\t\tconst tag = options.tag || activeTag;\n\n\t\t// Always read tasks from local file storage for export\n\t\tconst fileStorage = new FileStorage(this.configManager.getProjectRoot());\n\t\tawait fileStorage.initialize();\n\n\t\t// Load tasks with filters applied","sourceCodeStart":811,"sourceCodeEnd":847,"githubUrl":"https://github.com/eyaltoledano/claude-task-master/blob/c0c98d367c55296bfe69e65680625b6db437af02/packages/tm-core/src/modules/integration/services/export.service.ts#L811-L847","documentation":"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.","triggerScenarios":"Calling generateBriefFromTasks with no orgId in options and no orgId in the stored auth context, while the authenticated Hamster user belongs to no organization.","commonSituations":"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.","solutions":["Log into Hamster and create an organization, then retry.","Pass an explicit orgId in the options if you have one.","Run `tm auth` to confirm the session and check which orgs the account can see.","Verify you authenticated with the intended account (not a throwaway)."],"exampleFix":"// before\nawait exportService.generateBriefFromTasks({ title: 'My brief' });\n// after\nawait exportService.generateBriefFromTasks({ title: 'My brief', orgId: 'org_123' }); // or create an org in Hamster first","handlingStrategy":"validation","validationCode":"const orgs = await tmCore.auth.getOrganizations();\nif (orgs.length === 0) throw new Error('Create an organization in Hamster before generating briefs');","typeGuard":"function hasOrgId(o: { orgId?: string | null }): o is { orgId: string } {\n  return typeof o.orgId === 'string' && o.orgId.length > 0;\n}","tryCatchPattern":"const result = await exportService.generateBriefFromTasks(opts);\nif (!result.success && result.error?.code === 'NO_ORGANIZATIONS') {\n  promptUser('Create an organization in Hamster, then retry.');\n}","preventionTips":["Create an organization during onboarding before calling brief APIs","Pass orgId explicitly rather than relying on stored context","Check `tm auth` output to confirm org membership before automation runs"],"tags":["organization","auth","configuration","brief"],"backgroundTag":"missing-organization","analyzedSha":"c0c98d367c55296bfe69e65680625b6db437af02","analyzedAt":"2026-08-29T02:56:26.071Z","schemaVersion":2},"datasetVersion":"2026-08-29T07:17:48.351Z"}