MCPcopy
hub / github.com/codeaashu/claude-code / getExistingSessionFile

Method getExistingSessionFile

src/utils/sessionStorage.ts:1285–1300  ·  view source on GitHub ↗
(
    sessionId: UUID,
  )

Source from the content-addressed store, hash-verified

1283 */
1284 private existingSessionFiles = new Map<string, string>()
1285 private async getExistingSessionFile(
1286 sessionId: UUID,
1287 ): Promise<string | null> {
1288 const cached = this.existingSessionFiles.get(sessionId)
1289 if (cached) return cached
1290
1291 const targetFile = getTranscriptPathForSession(sessionId)
1292 try {
1293 await stat(targetFile)
1294 this.existingSessionFiles.set(sessionId, targetFile)
1295 return targetFile
1296 } catch (e) {
1297 if (isFsInaccessible(e)) return null
1298 throw e
1299 }
1300 }
1301
1302 private async persistToRemote(sessionId: UUID, entry: TranscriptMessage) {
1303 if (isShuttingDown()) {

Callers 1

appendEntryMethod · 0.95

Calls 5

statFunction · 0.85
isFsInaccessibleFunction · 0.85
getMethod · 0.65
setMethod · 0.45

Tested by

no test coverage detected