MCPcopy Create free account
hub / github.com/codeaashu/claude-code / regenerateSessionId

Function regenerateSessionId

src/bootstrap/state.ts:435–450  ·  view source on GitHub ↗
(
  options: { setCurrentAsParent?: boolean } = {},
)

Source from the content-addressed store, hash-verified

433}
434
435export function regenerateSessionId(
436 options: { setCurrentAsParent?: boolean } = {},
437): SessionId {
438 if (options.setCurrentAsParent) {
439 STATE.parentSessionId = STATE.sessionId
440 }
441 // Drop the outgoing session's plan-slug entry so the Map doesn't
442 // accumulate stale keys. Callers that need to carry the slug across
443 // (REPL.tsx clearContext) read it before calling clearConversation.
444 STATE.planSlugCache.delete(STATE.sessionId)
445 // Regenerated sessions live in the current project: reset projectDir to
446 // null so getTranscriptPath() derives from originalCwd.
447 STATE.sessionId = randomUUID() as SessionId
448 STATE.sessionProjectDir = null
449 return STATE.sessionId
450}
451
452export function getParentSessionId(): SessionId | undefined {
453 return STATE.parentSessionId

Callers 1

clearConversationFunction · 0.85

Calls 1

deleteMethod · 0.65

Tested by

no test coverage detected