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

Function getSessionRecordingPaths

src/utils/asciicast.ts:55–74  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

53 * Returns paths sorted by filename (chronological by timestamp suffix).
54 */
55export function getSessionRecordingPaths(): string[] {
56 const sessionId = getSessionId()
57 const projectsDir = join(getClaudeConfigHomeDir(), 'projects')
58 const projectDir = join(projectsDir, sanitizePath(getOriginalCwd()))
59 try {
60 // eslint-disable-next-line custom-rules/no-sync-fs -- called during /share before upload, not in hot path
61 const entries = getFsImplementation().readdirSync(projectDir)
62 const names = (
63 typeof entries[0] === 'string'
64 ? entries
65 : (entries as { name: string }[]).map(e => e.name)
66 ) as string[]
67 const files = names
68 .filter(f => f.startsWith(sessionId) && f.endsWith('.cast'))
69 .sort()
70 return files.map(f => join(projectDir, f))
71 } catch {
72 return []
73 }
74}
75
76/**
77 * Rename the recording file to match the current session ID.

Callers

nothing calls this directly

Calls 4

getSessionIdFunction · 0.85
getOriginalCwdFunction · 0.85
getFsImplementationFunction · 0.85
sanitizePathFunction · 0.70

Tested by

no test coverage detected