MCPcopy Index your code
hub / github.com/codeaashu/claude-code / loadAllSubagentTranscriptsFromDisk

Function loadAllSubagentTranscriptsFromDisk

src/utils/sessionStorage.ts:4325–4347  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

4323
4324// Globs the session's subagents dir directly — unlike AppState.tasks, this survives task eviction.
4325export async function loadAllSubagentTranscriptsFromDisk(): Promise<{
4326 [agentId: string]: Message[]
4327}> {
4328 const subagentsDir = join(
4329 getSessionProjectDir() ?? getProjectDir(getOriginalCwd()),
4330 getSessionId(),
4331 'subagents',
4332 )
4333 let entries: Dirent[]
4334 try {
4335 entries = await readdir(subagentsDir, { withFileTypes: true })
4336 } catch {
4337 return {}
4338 }
4339 // Filename format is the inverse of getAgentTranscriptPath() — keep in sync.
4340 const agentIds = entries
4341 .filter(
4342 d =>
4343 d.isFile() && d.name.startsWith('agent-') && d.name.endsWith('.jsonl'),
4344 )
4345 .map(d => d.name.slice('agent-'.length, -'.jsonl'.length))
4346 return loadSubagentTranscripts(agentIds)
4347}
4348
4349// Exported so useLogMessages can sync-compute the last loggable uuid
4350// without awaiting recordTranscript's return value (race-free hint tracking).

Callers 1

FeedbackFunction · 0.85

Calls 6

getSessionProjectDirFunction · 0.85
getOriginalCwdFunction · 0.85
getSessionIdFunction · 0.85
readdirFunction · 0.85
loadSubagentTranscriptsFunction · 0.85
getProjectDirFunction · 0.70

Tested by

no test coverage detected