{"record":{"id":"d0070f3ec0f9c601","repo":"affaan-m/ECC","slug":"unsupported-claude-session-target-target","errorCode":null,"errorMessage":"Unsupported Claude session target: ${target}","messagePattern":"Unsupported Claude session target: (.+?)","errorType":"exception","errorClass":"Error","httpStatus":null,"severity":"error","filePath":"scripts/lib/session-adapters/claude-history.js","lineNumber":111,"sourceCode":"      session,\n      sourceTarget: {\n        type: 'claude-history',\n        value: explicitTarget\n      }\n    };\n  }\n\n  if (isSessionFileTarget(target, cwd)) {\n    return {\n      session: hydrateSessionFromPath(path.resolve(cwd, target)),\n      sourceTarget: {\n        type: 'session-file',\n        value: path.resolve(cwd, target)\n      }\n    };\n  }\n\n  throw new Error(`Unsupported Claude session target: ${target}`);\n}\n\nfunction createClaudeHistoryAdapter(options = {}) {\n  const persistCanonicalSnapshotImpl = options.persistCanonicalSnapshotImpl || persistCanonicalSnapshot;\n\n  return {\n    id: 'claude-history',\n    description: 'Claude local session history and session-file snapshots',\n    targetTypes: ['claude-history', 'claude-alias', 'session-file'],\n    canOpen(target, context = {}) {\n      if (context.adapterId && context.adapterId !== 'claude-history') {\n        return false;\n      }\n\n      if (context.adapterId === 'claude-history') {\n        return true;\n      }\n","sourceCodeStart":93,"sourceCodeEnd":129,"githubUrl":"https://github.com/affaan-m/ECC/blob/01e15490f04e29cfefe3896951f43db46994d8ee/scripts/lib/session-adapters/claude-history.js#L93-L129","documentation":"resolveSessionRecord exhausted every resolution branch: the target is not 'latest', not a known alias, not a session id found by getSessionById, and isSessionFileTarget(target,cwd) returned false (file does not exist, is not a file, or does not end in .tmp). The Claude history adapter cannot interpret the target string.","triggerScenarios":"Passing a target like a bare project name, a directory path, a non-.tmp file, or a typo. Passing a target with an unsupported prefix (e.g. 'foo:bar'). The referenced file does not exist on disk.","commonSituations":"User assumes the adapter accepts a project name or URL. Path is relative and resolved against the wrong cwd so the file is not found. The file extension is not .tmp so isSessionFileTarget rejects it.","solutions":["Use one of the supported forms: 'latest', a session id, a registered alias, or an absolute/relative path to an existing .tmp session file.","Verify the path exists and ends with '.tmp': fs.existsSync(p) && fs.statSync(p).isFile() && p.endsWith('.tmp').","If resolving from cwd, pass the correct cwd so the relative path resolves.","For structured targets, pass { type: 'claude-history'|'claude-alias'|'session-file', value: <path-or-id> } instead of an ambiguous string."],"exampleFix":"// before\nadapter.open('my-project', { cwd }); // unsupported\n\n// after\nadapter.open('latest', { cwd });\n// or\nadapter.open('/abs/path/to/session.tmp', { cwd });\n// or structured\nadapter.open({ type: 'session-file', value: '/abs/path/to/session.tmp' }, { cwd });","handlingStrategy":"validation","validationCode":"function assertClaudeTargetShape(target, cwd) {\n  if (target === 'latest') return;\n  if (sessionAliases.resolveAlias(target)) return;\n  if (sessionManager.getSessionById(target, true)) return;\n  const abs = path.resolve(cwd, target);\n  if (!fs.existsSync(abs) || !fs.statSync(abs).isFile() || !abs.endsWith('.tmp')) {\n    throw new Error(`Unsupported Claude target: ${target}. Use 'latest', an id, an alias, or a .tmp file path.`);\n  }\n}","typeGuard":"function isClaudeTargetPlausible(target, cwd) {\n  if (target === 'latest') return true;\n  if (typeof target !== 'string') return false;\n  const abs = path.resolve(cwd, target);\n  return fs.existsSync(abs) && fs.statSync(abs).isFile() && abs.endsWith('.tmp');\n}","tryCatchPattern":"try { return resolveSessionRecord(target, cwd); }\ncatch (err) {\n  if (err.message.startsWith('Unsupported Claude session target:')) {\n    throw new Error(`${err.message}. Supported: 'latest' | session id | alias | path to a .tmp file.`);\n  }\n  throw err;\n}","preventionTips":["Pass an absolute .tmp path when in doubt.","Use structured targets {type:'session-file', value:absPath} for clarity.","Validate the target string shape before calling the adapter."],"tags":["claude-history","session-resolution","unsupported-target"],"backgroundTag":null,"analyzedSha":"01e15490f04e29cfefe3896951f43db46994d8ee","analyzedAt":"2026-08-13T00:31:08.655Z","schemaVersion":2},"datasetVersion":"2026-08-13T04:17:16.726Z"}