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

Function gatherAllCandidates

src/utils/listSessionsImpl.ts:406–423  ·  view source on GitHub ↗

* Gathers candidate session files across all project directories.

(doStat: boolean)

Source from the content-addressed store, hash-verified

404 * Gathers candidate session files across all project directories.
405 */
406async function gatherAllCandidates(doStat: boolean): Promise<Candidate[]> {
407 const projectsDir = getProjectsDir()
408
409 let dirents: Dirent[]
410 try {
411 dirents = await readdir(projectsDir, { withFileTypes: true })
412 } catch {
413 return []
414 }
415
416 const perProject = await Promise.all(
417 dirents
418 .filter(d => d.isDirectory())
419 .map(d => listCandidates(join(projectsDir, d.name), doStat)),
420 )
421
422 return perProject.flat()
423}
424
425/**
426 * Lists sessions with metadata extracted from stat + head/tail reads.

Callers 1

listSessionsImplFunction · 0.85

Calls 3

readdirFunction · 0.85
listCandidatesFunction · 0.85
getProjectsDirFunction · 0.70

Tested by

no test coverage detected