MCPcopy Create free account
hub / github.com/WJX20/claude-code / getExistingSessionFile

Method getExistingSessionFile

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

Source from the content-addressed store, hash-verified

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

Callers 1

appendEntryMethod · 0.95

Calls 5

statFunction · 0.85
isFsInaccessibleFunction · 0.85
setMethod · 0.80
getMethod · 0.45

Tested by

no test coverage detected