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

Function switchSession

src/bootstrap/state.ts:468–479  ·  view source on GitHub ↗
(
  sessionId: SessionId,
  projectDir: string | null = null,
)

Source from the content-addressed store, hash-verified

466 * carries over from the previous session.
467 */
468export function switchSession(
469 sessionId: SessionId,
470 projectDir: string | null = null,
471): void {
472 // Drop the outgoing session's plan-slug entry so the Map stays bounded
473 // across repeated /resume. Only the current session's slug is ever read
474 // (plans.ts getPlanSlug defaults to getSessionId()).
475 STATE.planSlugCache.delete(STATE.sessionId)
476 STATE.sessionId = sessionId
477 STATE.sessionProjectDir = projectDir
478 sessionSwitched.emit(sessionId)
479}
480
481const sessionSwitched = createSignal<[id: SessionId]>()
482

Callers 8

runFunction · 0.85
setupFunction · 0.85
hydrateRemoteSessionFunction · 0.85
onSelectFunction · 0.85
REPLFunction · 0.85
loadInitialMessagesFunction · 0.85

Calls 2

emitMethod · 0.80
deleteMethod · 0.65

Tested by

no test coverage detected